php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54743 parse_ini_file() does not allow the word 'no' as part of ini values
Submitted: 2011-05-16 07:07 UTC Modified: 2011-05-16 10:43 UTC
From: adam at papsy dot net Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.3.6 OS: Windows 7 (x64)
Private report: No CVE-ID: None
 [2011-05-16 07:07 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-16 10:43 UTC] johannes@php.net
-Status: Open +Status: Bogus
 [2011-05-16 10:43 UTC] johannes@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC