Edit report at http://pear.php.net/bugs/bug.php?id=12388&edit=1

ID: 12388
Updated by: cweiske@php.net
Reported By: pear at j9ac9k dot info
Summary: GenericConf doesn't allow whitepace to left of
directive delimiter
-Status: Open
+Status: Closed
Type: Bug
Package: Config
Operating System: irrelevant
Package Version: 1.10.11
PHP Version: 4.4.7
-Assigned To:
+Assigned To: cweiske
Roadmap Versions:
New Comment:

-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 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.

Previous Comments:

[2007-11-06 00:04:16] paleozogt

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";

$file = fopen($testfile, "w");
fwrite($file, $configtext);

$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=""]"


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedDec 20, '10 at 8:40p
activeDec 20, '10 at 8:40p

1 user in discussion

Cweiske: 1 post



site design / logo © 2022 Grokbase