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
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: 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

Pull Requests

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: Sat Dec 21 16:01:28 2024 UTC