PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Configuration » Config » Bug #3398

Bug in Quote and Comma Parser for IniCommented

Details

Submitted2005-02-08 01:53 UTC
Fromayourk at hotmail dot com
Assignedryansking
StatusClosed
PackageConfig
PHP Version4.3.10
OSFreeBSD
Roadmaps(Not assigned)

Comments

[2005-02-08 01:53 UTC] ayourk at hotmail dot com

Description:
------------
In a directive that is an array of values, sometimes it doesn't seperate the different array values properly.
I'm using:

Installed packages:
===================
Package Version State
Config 1.10.3 stable
XML_Parser 1.2.4 stable
XML_RPC 1.2.0RC6 beta
XML_Util 1.1.1 stable

Reproduce code:
---------------
Config file:
[Preset]
presets=common

[common]
sntpTZ=type=4, "value=CST6DST5,M4.1.0/02:00:00,M10.5.0/02:00:00", name=sntpTZ, label=TimeZone, form=text, "select=array (value => %value, size => 37);"

Code file:
<?php
require_once('Config.php');
$config = new Config();
$root =& $config->parseConfig('samplebug.conf', 'inicommented');
if (PEAR::isError($root)) {
die('Error while reading configuration: ' . $root->getMessage() . "\r\n");
}
echo "<pre>";
var_export($root->toArray());
echo "</pre>";
?>

Expected result:
----------------
Master Key: array (
'root' =>
array (
'Preset' =>
array (
'presets' => 'common',
),
'common' =>
array (
'sntpTZ' =>
array (
0 => 'type=4',
1 => 'value=CST6DST5,M4.1.0/02:00:00,M10.5.0/02:00:00'
2 => 'name=sntpTZ',
3 => 'label=TimeZone',
4 => 'form=text',
5 => 'select=array (value => %value, size => 37);',
),
),
),
)

Actual result:
--------------
Master Key: array (
'root' =>
array (
'Preset' =>
array (
'presets' => 'common',
),
'common' =>
array (
'sntpTZ' =>
array (
0 => 'type=4',
1 => 'value=CST6DST5,M4.1.0/02:00:00,M10.5.0/02:00:00 name=sntpTZ',
2 => 'label=TimeZone',
3 => 'form=text',
4 => 'select=array (value => %value, size => 37);',
),
),
),
)

[2005-04-09 03:43 UTC] ryansking at mac dot com

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.

Please take a look at the CVS and give it a spin.
Thanks.