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)    

 [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


 [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 by the end of next Sunday (CET). If this was a problem with the 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.