php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44842 parse_ini_file keys that start/end with underscore
Submitted: 2008-04-26 17:12 UTC Modified: 2008-08-17 21:59 UTC
Votes:5
Avg. Score:4.4 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: galactic dot void at googlemail dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 5.3CVS-2008-04-26 (snap) OS: *
Private report: No CVE-ID:
 [2008-04-26 17:12 UTC] galactic dot void at googlemail dot com
Description:
------------
parse_ini_file cannot handle keys that start/end with an underscore.

Reproduce code:
---------------
// my.ini
test   = 1
_test  = 2
test_  = 3

[section]
test  = 1
_test = 2
test_ = 3

// ini.php
print_r(parse_ini_file('my.ini', true));

Expected result:
----------------
Array
(
    [test] => 1
    [_test] => 2
    [test_] => 3
    [section] => Array
        (
            [test] => 1
            [_test] => 2
            [test_] => 3
        )

)


Actual result:
--------------
Array
(
    [test] => 1
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-17 21:59 UTC] lbarnaud@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 13:01:59 2014 UTC