ID: 49461
Comment by: oc3ans at gmail dot com
Reported By: sebastian dot schleussner at angstrom dot uu dot se
Status: Open
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 5.3.0
New Comment:
According to accepted standards of ini files the semicolon is starting
a
comment that lasts till the end of the line, so IMHO this is not a bug,
if you want to include semicolons in the keys or sections you should
escape it with a backslash.
Previous Comments:
------------------------------------------------------------------------
[2009-09-03 20:17:37] sebastian dot schleussner at angstrom dot uu dot
se
Description:
------------
This is a follow-up to Bug #49443.
The character breaking parse_ini_file of PHP 5.3.0 with browscap.ini is
actually the comment character ";" inside section headers - not one of
the special characters.
Reproduce code:
---------------
;sample1.ini
; demonstration of what works in 5.2 and 5.3
[a(b){c}&~![^]
x=y
;sample2.ini
; demonstration of the problem
[a;b];c
x=y
Code:
-----
<?php
print_r(parse_ini_file('sample1.ini', true));
print_r(parse_ini_file('sample2.ini', true));
?>
Expected result:
----------------
As in PHP 5.2.10 -- the header's square brackets being interpreted as
quoting:
Array
(
[a(b){c}&~![^] => Array
(
[x] => y
)
)
Array
(
[a;b] => Array
(
[x] => y
)
)
Actual result:
--------------
Array
(
[a(b){c}&~![^] => Array
(
[x] => y
)
)
PHP Warning: syntax error, unexpected $end, expecting ']' in
sample2.ini on line 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49461&edit=1