FAQ
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

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

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 20, '10 at 8:40p
activeDec 20, '10 at 8:40p
posts1
users1
websitepear.php.net

1 user in discussion

Cweiske: 1 post

People

Translate

site design / logo © 2022 Grokbase