PEAR is archived and read-only

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

Home » Configuration » Config » Bug #3780

PHPArray: no addslashes at array-keys

Details

Submitted2005-03-11 20:55 UTC
Fromwerner dot krauss at hallstatt dot net
Assignedryansking
StatusClosed
PackageConfig
PHP Version4.3.9
Roadmaps(Not assigned)

Comments

[2005-03-11 20:55 UTC] werner dot krauss at hallstatt dot net

Description:
------------
When saving an php array, that contains something like

$words['each user\'s'] = 'foobar';

PEAR::Config will save it this way:

$words['each user's'] = 'foobar';

which causes php to fail when the file with the phparray is included the next time.

Reproduce code:
---------------
In Config/Container/PHPArray.php i added a little addslashes in line 216: function _getParentString(&$obj)

$string .= '$'.$this->options['name']."['".addslashes($obj->name)."']";

this helps.

Expected result:
----------------
Array should be saved correctly. (see above)

Actual result:
--------------
$words['each user's'] = 'foobar';

[2005-04-02 00:21 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.

I've fixed this in CVS, I'll roll a new release after I
clean up a few more issues.