#48769 [NEW]: parse_ini_file() equal sign issue with INI_SCANNER_RAW

[email protected] ("[email protected]")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             [email protected]
Operating system: Linux x86
PHP version:      5.3CVS-2009-07-02 (CVS)
PHP Bug Type:     Filesystem function related
Bug description:  parse_ini_file() equal sign issue with INI_SCANNER_RAW

Description:
------------
In addition to bug 48768, which is a parse_ini_file() crasher when
INI_SCANNER_RAW mode is used, there's also an issue with configuration
items containing equal signs in general which results in a (seemingly)
spurious warning.

Given that INI_SCANNER_RAW is new and only minimally documented, this may
in fact be intended behaviour, in which case this should probably be
changed to a documentation problem. It would seem odd that changing the
scanner mode would prevent properly double-quoted configuration values from
being parsed, though.

Reproduce code:
---------------
INI file:

equal = "foo=bar"


PHP script:

$ini = parse_ini_file('equals.ini', false, INI_SCANNER_NORMAL);
var_dump($ini);

$ini = parse_ini_file('equals.ini', false, INI_SCANNER_RAW);
var_dump($ini);


Expected result:
----------------
array(1) {
  ["equal"]=>
  string(7) "foo=bar"
}
array(1) {
  ["equal"]=>
  string(7) "foo=bar"
}


Actual result:
--------------
array(1) {
  ["equal"]=>
  string(7) "foo=bar"
}

Warning: syntax error, unexpected '"' in equals.ini on line 1
 in /tmp/equals.php on line 5

Call Stack:
    0.0007     324132   1. {main}() /tmp/equals.php:0
    0.0012     324544   2. parse_ini_file() /tmp/equals.php:5


-- 
Edit bug report at http://bugs.php.net/?id=48769&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        http://bugs.php.net/fix.php?id=48769&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        http://bugs.php.net/fix.php?id=48769&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        http://bugs.php.net/fix.php?id=48769&r=trysnapshot60
Fixed in CVS:                        http://bugs.php.net/fix.php?id=48769&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48769&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=48769&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=48769&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=48769&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=48769&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=48769&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=48769&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=48769&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=48769&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=48769&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48769&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48769&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=48769&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=48769&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=48769&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=48769&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=48769&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.