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: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: galactic dot void at googlemail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC