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

Bug #18155 Value strings inside arrays are not escaped
Submitted: 2010-12-29 02:09 UTC
From: masonm Assigned: till
Status: Closed Package: File_IMC (version SVN)
PHP Version: 5.3.3 OS: Mac OS X
Roadmaps: 0.4.2    
Subscription  


 [2010-12-29 02:09 UTC] masonm (Mason Malone)
Description: ------------ The File_IMC_Parse_Vcard class is supposed to unescape strings inside vCards, but it fails for strings inside arrays due to a due a bug in the File_IMC_Parse->_unescape method. Test script: --------------- <? $testVcard = ' BEGIN:VCARD VERSION:3.0 N:Someone;Someone;;; FN:Someone ADR;type=WORK;type=pref:;;22221 W\, Unit 3;Somewhere;IL;60002; END:VCARD '; require_once 'File/IMC.php'; $parse = File_IMC::parse('vCard'); $cardinfo = $parse->fromText($testVcard); var_dump($cardinfo['VCARD'][0]['ADR']); ?> Expected result: ---------------- array(1) { [0]=> string(16) "22221 W, Unit 3" } Actual result: -------------- array(1) { [0]=> string(16) "22221 W\, Unit 3" }

Comments

 [2010-12-29 02:12 UTC] masonm (Mason Malone)
Added patch fix.
 [2010-12-29 02:14 UTC] masonm (Mason Malone)
The last line of the test script should var_dump($cardinfo['VCARD'][0]['ADR'][0]['value'][File_IMC::VCARD_ADR_STREET]);
 [2011-03-11 22:40 UTC] till (Till Klampaeckel)
-Status: Open +Status: Closed -Assigned To: +Assigned To: till
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. Thanks for the test script and the report. I converted it into a test and it's all fixed and committed.
 [2011-03-11 22:40 UTC] till (Till Klampaeckel)
-Roadmap Versions: +Roadmap Versions: 0.4.2
Roadmapped.