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

Bug #7544 Empty attributes in ini file are being discarded
Submitted: 2006-05-02 17:12 UTC
From: luis at m3 dot net Assigned: aashley
Status: Closed Package: Config (version 1.10.6)
PHP Version: 5.0.4 OS: 2.6.15-1.1830_FC4smp
Roadmaps: (Not assigned)    
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 : 36 - 13 = ?

 
 [2006-05-02 17:12 UTC] luis at m3 dot net (Luis Correa d'Almeida)
Description: ------------ Parsing an ini file using IniCommented container is losing the empty attributes. Test script: --------------- [mySection] myFirstAtt=123 mySecondAtt= $oConfig = new Config(); $oConfig->parseConfig($filename, 'IniCommented'); The element mySecondAtt is lost. PATCH: --- pear/Config/Container/IniCommented.php (revision 4831) +++ pear/Config/Container/IniCommented.php (working copy) @@ -121,8 +121,12 @@ function _quoteAndCommaParser($text) { $text = trim($text); - if ($text == '') { - return array(); + if ($text == '') + { + $emptyNode = array(); + $emptyNode[0][0] = 'normal'; + $emptyNode[0][1] = ''; + return $emptyNode; } Expected result: ---------------- It is expected for the parser to aknowledge and store the empty attribute Actual result: -------------- The parser discards the empty attribute

Comments

 [2006-05-30 06:51 UTC] aashley at php dot net (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.