ID: 44442
Updated by: [EMAIL PROTECTED]
Reported By: VJTD3 at VJTD3 dot com
Status: Open
Bug Type: Filesystem function related
Operating System: any
PHP Version: 5.2.5
New Comment:
Says the documentation:
"Note: If a value in the ini file contains any non-alphanumeric
characters it needs to be enclosed in double-quotes (")."
"... Characters {}|&~![()" must not be used anywhere in the key and
have a special meaning in the value."
Previous Comments:
------------------------------------------------------------------------
[2008-03-15 10:33:24] VJTD3 at VJTD3 dot com
Description:
------------
if a ini file has a "(" or ")" in it the parse_ini_file function will
end on the character before the "(" or ")". in some cases or remove the
"(" and ")" or just dump everything between the "(" and ")".
In a nut shell it hates "(" and ")" for some reason.
Reproduce code:
---------------
sample "demo.ini" file:
[demo]
a=1
b=(
c=3
php -r "print_r(parse_ini_file('demo.ini', true));"
Expected result:
----------------
Array
(
[demo] => Array
(
[a] => 1
[b] => (
[c] => 3
)
)
Actual result:
--------------
Warning: Error parsing demo.ini on line 3
Array
(
[demo] => Array
(
[a] => 1
[b] =>
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44442&edit=1