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

Bug #12388 GenericConf doesn't allow whitepace to left of directive delimiter
Submitted: 2007-11-06 05:04 UTC
From: paleozogt Assigned: cweiske
Status: Closed Package: Config (version 1.10.11)
PHP Version: 4.4.7 OS: irrelevant
Roadmaps: (Not assigned)    

 [2007-11-06 05:04 UTC] paleozogt (Aaron Simmons)
Description: ------------ GenericConf doesn't allow whitespace to the left of the directive delimiter (the 'equals' option). For example, this is valid: keyword: value but this is not keyword :value The regex used in GenericConf allows for any amount of whitespace to the *right* of the delimiter ("\s*") but doesn't allow for any on the *left* side of the delimiter. Test script: --------------- function demobug() { // this will fail unless you remove the // space to the left of the colon $configtext= "keyword : value"; $testfile="/tmp/testconfig.conf"; $file = fopen($testfile, "w"); fwrite($file, $configtext); fclose($file); $c = new Config(); $conf=& $c->parseConfig($testfile, "GenericConf"); echo $conf->toString('GenericConf', $options); } Expected result: ---------------- It should display "keyword:value". Actual result: -------------- Instead it displays, "[pear_error: message="Syntax error in '/tmp/testconfig.conf' at line 1." code=0 mode=return level=notice prefix="" info=""]"


 [2010-12-21 02:41 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Closed -Assigned To: +Assigned To: cweiske
This bug has been fixed in SVN. 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.