cvs: pear /Contact_Vcard_Build Contact_Vcard_Build.php
| From: | Paul Jones | Date: | Sat, 28 May 2005 14:49:57 +0000 |
| Subject: | cvs: pear /Contact_Vcard_Build Contact_Vcard_Build.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-32177@lists.php.net to get a copy of this message | ||
pmjones Sat May 28 10:49:57 2005 EDT
Modified files:
/pear/Contact_Vcard_Build Contact_Vcard_Build.php
Log:
fixed bug 2660 "escape() doesn't escape colons"
http://cvs.php.net/diff.php/pear/Contact_Vcard_Build/Contact_Vcard_Build.php?r1=1.1&r2=1.2&ty=u
Index: pear/Contact_Vcard_Build/Contact_Vcard_Build.php
diff -u pear/Contact_Vcard_Build/Contact_Vcard_Build.php:1.1
pear/Contact_Vcard_Build/Contact_Vcard_Build.php:1.2
--- pear/Contact_Vcard_Build/Contact_Vcard_Build.php:1.1 Sun Apr 25 12:21:34 2004
+++ pear/Contact_Vcard_Build/Contact_Vcard_Build.php Sat May 28 10:49:56 2005
@@ -16,7 +16,7 @@
// | Authors: Paul M. Jones <pjones@ciaweb.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Contact_Vcard_Build.php,v 1.1 2004/04/25 16:21:34 pmjones Exp $
+// $Id: Contact_Vcard_Build.php,v 1.2 2005/05/28 14:49:56 pmjones Exp $
/**
*
@@ -167,6 +167,10 @@
} else {
+ // escape colons not led by a backslash
+ $regex = '(?<!\\\\)(\:)';
+ $text = preg_replace("/$regex/i", "\\:", $text);
+
// escape semicolons not led by a backslash
$regex = '(?<!\\\\)(\;)';
$text = preg_replace("/$regex/i", "\\;", $text);