php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17462 parse_ini_file does wrong thing with spaces in section markers
Submitted: 2002-05-27 14:46 UTC Modified: 2002-06-04 18:05 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: nathan at dstatement dot com Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.1.2 OS: Linux-2.4/Debian Testing
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nathan at dstatement dot com
New email:
PHP Version: OS:

 

 [2002-05-27 14:46 UTC] nathan at dstatement dot com
Given an ini file that looks like this (quotes added for emphasis):

"[section1]"
foo = bar
blah = ya

"[section2] "
fooz = blat
ya = John YaYa

the resulting array when parsed with parse_ini_file('filename.ini', TRUE) would end up looking much like this:
Array
(
  [section1] = Array
    (
      (
        [foo] => bar
        [blah] => ya
        [fooz] => blat
        [ya] => John YaYa   
      )
    )
)

Eg section1 and  section2 would be merged together under section1 when the line containing marker for section2 did not end with "]"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-04 18:05 UTC] derick@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.

kudos to Edin!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Sep 29 01:01:26 2024 UTC