php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67093 parse_ini_file can't handle space before "["
Submitted: 2014-04-17 08:59 UTC Modified: 2014-04-17 17:02 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: swan886 at gmail dot com Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 5.5.11 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: swan886 at gmail dot com
New email:
PHP Version: OS:

 

 [2014-04-17 08:59 UTC] swan886 at gmail dot com
Description:
------------
If the ini file contains space before [, the parse_ini_file will not get correct result. For ex,

change
[section]
  param = value

to 

 [section]
param=value

result will be wrong.

Test script:
---------------
The simplest test way is to change php.ini's first

[PHP] 

to 

 [PHP]


I use a simple solution to fix this. 

modify Zend/zend_ini_scanner.l   
line 359  <INITIAL>"[" {   =>  <INITIAL>{TABS_AND_SPACES}*"[" { 

but this is for 5.5.3




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-17 17:02 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2014-04-17 17:02 UTC] ab@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Why should this be an issue? Actually that is a usual format also documented in desktop entry spec. Implementations may vary, PHP's one is fine with that spec.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC