cvs: pear /Contact_Vcard_Parse Contact_Vcard_Parse.php test.vcf
| From: | Paul Jones | Date: | Tue, 31 May 2005 16:55:58 +0000 |
| Subject: | cvs: pear /Contact_Vcard_Parse Contact_Vcard_Parse.php test.vcf | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-32275@lists.php.net to get a copy of this message | ||
pmjones Tue May 31 12:55:58 2005 EDT
Modified files:
/pear/Contact_Vcard_Parse Contact_Vcard_Parse.php test.vcf
Log:
combined unescape() replacements per dev note from Daniel Convissor
http://cvs.php.net/diff.php/pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php?r1=1.4&r2=1.5&ty=u
Index: pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php
diff -u pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php:1.4
pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php:1.5
--- pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php:1.4 Sat May 28 11:40:17 2005
+++ pear/Contact_Vcard_Parse/Contact_Vcard_Parse.php Tue May 31 12:55:58 2005
@@ -16,7 +16,7 @@
// | Authors: Paul M. Jones <pmjones@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Contact_Vcard_Parse.php,v 1.4 2005/05/28 15:40:17 pmjones Exp $
+// $Id: Contact_Vcard_Parse.php,v 1.5 2005/05/31 16:55:58 pmjones Exp $
/**
@@ -294,10 +294,16 @@
$text[$key] = $val;
}
} else {
+ /*
$text = str_replace('\:', ':', $text);
$text = str_replace('\;', ';', $text);
$text = str_replace('\,', ',', $text);
$text = str_replace('\n', "\n", $text);
+ */
+ // combined
+ $find = array('\:', '\;', '\,', '\n');
+ $replace = array(':', ';', ',', "\n");
+ $text = str_replace($find, $replace, $text);
}
}
@@ -700,7 +706,7 @@
function _parseN($text)
{
- // make sure there are always at least 5 elements
+ // make sure there are always at least 5 elements
$tmp = array_pad($this->splitBySemi($text), 5, '');
return array(
$this->splitByComma($tmp[0]), // family (last)
@@ -731,7 +737,7 @@
function _parseADR($text)
{
- // make sure there are always at least 7 elements
+ // make sure there are always at least 7 elements
$tmp = array_pad($this->splitBySemi($text), 7, '');
return array(
$this->splitByComma($tmp[0]), // pob
@@ -829,7 +835,7 @@
function _parseGEO($text)
{
- // make sure there are always at least 2 elements
+ // make sure there are always at least 2 elements
$tmp = array_pad($this->splitBySemi($text), 2, '');
return array(
array($tmp[0]), // lat
http://cvs.php.net/diff.php/pear/Contact_Vcard_Parse/test.vcf?r1=1.1&r2=1.2&ty=u
Index: pear/Contact_Vcard_Parse/test.vcf
diff -u pear/Contact_Vcard_Parse/test.vcf:1.1 pear/Contact_Vcard_Parse/test.vcf:1.2
--- pear/Contact_Vcard_Parse/test.vcf:1.1 Sun May 2 08:59:25 2004
+++ pear/Contact_Vcard_Parse/test.vcf Tue May 31 12:55:58 2005
@@ -5,4 +5,5 @@
ADR;TYPE=HOME,WORK:;;123 Main,Apartment 101;Beverly Hills;CA;90210
EMAIL;TYPE=HOME;TYPE=WORK:boshag@example.com
EMAIL;TYPE=PREF:boshag@ciaweb.net
+TITLE:The Title\: The Subtitle
END:VCARD