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

Bug #11184 PHPArray issue with backslashes
Submitted: 2007-05-31 09:53 UTC
From: tomdesp Assigned: aashley
Status: Closed Package: Config (version 1.10.10)
PHP Version: 5.1.6 OS: All
Roadmaps: 1.10.11    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 21 + 28 = ?

 
 [2007-05-31 09:53 UTC] tomdesp (Thomas Despoix)
Description: ------------ This bug is a duplicate of former Bug #10185 (problem with addslashs in container "PHPArray" / method "toString"). Changing PHP string delimiters from single to double quotes, didn't solve anything, since we now have the exact same problem with unnecessary blackslashes before in-string single quotes. I really recommend to use addcslashes(), as Wiedmann previously suggested, instead of addslashes(), whatever delimiter use choose. Test script: --------------- <?php require_once("Config.php"); $path = "config_test.php"; $type = "phparray"; $options = array ( "name" => "actualValues", ); $expectedValues = array ( "single-quotes-test" => "Text with 'simple quotes'", "double-quotes-test" => 'Text with "double quotes"', ); echo "Expected values: "; print_r($expectedValues); $config = new Config; $config->parseConfig($expectedValues, $type, $options); $config->writeConfig($path, $type, $options); require_once($path); echo "Actual values: "; print_r($actualValues); ?> Expected result: ---------------- cf. test script Actual result: -------------- cf. test script

Comments

 [2007-06-12 05:25 UTC] aashley (Adam Ashley)
This bug has been fixed in CVS. 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.