Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.12

Bug #21206 explodeQuotedString() does not handle quoted strings correctly
Submitted: 2017-04-29 19:40 UTC
From: dfukagaw28 Assigned: alec
Status: Closed Package: Mail_Mime (version 1.10.0)
PHP Version: 5.6.30 OS:
Roadmaps: 1.10.1    
Subscription  


 [2017-04-29 19:40 UTC] dfukagaw28 (Daiji Fukagawa)
Description: ------------ Mail_mimePart::explodeQuotedString() fails for quoted strings ending with backslash. Moreover, it can not handle strings which contains special octets 0x22 (double quote) or 0x5C (backslash). Some character encodings (e.g., ISO-2022-JP, which has been the de- facto charset in Japanese e-mails) may contain 0x22 or 0x5C. Test script: --------------- require_once('Mail/mimePart.php'); class X extends Mail_mimePart { public static function explodeQuotedString($delimiter, $string){ return Mail_mimePart::explodeQuotedString($delimiter, $string); } } $test = '"a\\\\" <a@a.a>, b <b@b.b>'; $addrs = X::explodeQuotedString("[\t,]", $test); foreach ($addrs as $addr) { print trim($addr) . PHP_EOL; } Expected result: ---------------- "a\\" <a@a.a> b <b@b.b> Actual result: -------------- "a\\" <a@a.a>, b <b@b.b>

Comments

 [2017-05-05 08:55 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alec
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.