PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » Contact_Vcard_Build » Bug #2660

escape() doesn't escape colons

Details

Submitted2004-11-01 15:19 UTC
Fromcmoehrke at netviser dot de
Assignedpmjones
StatusClosed
PackageContact_Vcard_Build
PHP Version5.0.2
OSLinux
Roadmaps(Not assigned)

Comments

[2004-11-01 15:19 UTC] cmoehrke at netviser dot de

Description:
------------
The member function escape()escape semi-colons and commas but it doesn't escape colons.
Excerpt from RFC 2426:
In addition, any COMMA character (ASCII decimal 44),
SEMI-COLON character (ASCII decimal 59) and COLON character (ASCII
decimal 58) MUST be escaped with the BACKSLASH character (ASCII
decimal 92).

Reproduce code:
---------------
$string="A;A,A:A";
Contact_Vcard_Build::escape($string);
echo $string;

Expected result:
----------------
A\;A\,A\:A

Actual result:
--------------
A\;A\,A:A