Bug #54743 [Opn->Bgs]: parse_ini_file() does not allow the word 'no' as part of ini values
Edit report at http://bugs.php.net/bug.php?id=54743&edit=1
ID: 54743
Updated by: johannes@php.net
Reported by: adam at papsy dot net
Summary: parse_ini_file() does not allow the word 'no' as
part of ini values
-Status: Open
+Status: Bogus
Type: Bug
Package: PHP options/info functions
Operating System: Windows 7 (x64)
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Please quote free text.
ERR_GENERIC="Sorry, no results could be found."
The parser we are using is relatively simple.
Previous Comments:
------------------------------------------------------------------------
[2011-05-16 07:07:39] adam at papsy dot net
Description:
------------
This is my first time filing a bug report here so if I've left out
anything that
may be needed, please let me know.
The issue arises when calling parse_ini_file on a file that contains the
word
"no"
as part of _any_ value.
Additionally, this error seems to prevent the entire INI file from being
loaded
properly. In my actual code, database settings are defined first and
then error
messages second (and one of the error messages contain the word no).
When this
bug
is encountered, the database connection fails due to the previous
settings not
being parsed.
Lastly, this may be a re-post of:
http://bugs.php.net/50340
Test script:
---------------
example.php:
<?php $ini_data = parse_ini_file('config.ini'); ?>
config.ini:
[ERRORS]
ERR_GENERIC=Sorry, no results could be found.
Expected result:
----------------
No message should be displayed, and the resulting array should be
assigned to
$ini_data.
Actual result:
--------------
Warning: syntax error, unexpected BOOL_FALSE in required/config.ini on
line 2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54743&edit=1
Thread (2 messages)