Bug #68461 [Nab->ReO]: parse_ini_file not parsing conf file if it has line like "on="

From: Date: Wed, 03 Mar 2021 13:57:31 +0000
Subject: Bug #68461 [Nab->ReO]: parse_ini_file not parsing conf file if it has line like "on="
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232513@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68461&edit=1 ID: 68461 Updated by: cmb@php.net Reported by: sandeep dot singh dot bisht at gmail dot com Summary: parse_ini_file not parsing conf file if it has line like "on=" -Status: Not a bug +Status: Re-Opened Type: Bug Package: Filesystem function related Operating System: Ubuntu PHP Version: 5.5.19 -Assigned To: cmb +Assigned To: Block user comment: N Private report: N New Comment: Ugh, I thought that wouldn't affect INI_SCANNER_RAW, but obviously it does, and it is even documented. And yes, you're right, fixing this would not really cause a BC break. Previous Comments: ------------------------------------------------------------------------ [2021-03-03 13:40:38] krzysiek at example dot com This is also how parser is behaving with INI_SCANNER_RAW which is at least unexpected. In that mode I feel everything should be parsed as string. And also this probably wouldn't be a breaking change since with "on" in key, function will fail all together. Unless obviously someone is relaying on having error. ------------------------------------------------------------------------ [2020-10-07 16:03:37] cmb@php.net Well, we can't fix that without breaking valid code, and the "feature" behaves as advertized anyway[1]. So I'm going to close this as not a bug. [1] <https://www.php.net/manual/en/function.parse-ini-file.php> ------------------------------------------------------------------------ [2014-11-20 17:16:11] requinix@php.net See also bug #68347, though I don't think it can be reasonably argued that this version is not a bug either. ------------------------------------------------------------------------ [2014-11-20 12:42:31] sandeep dot singh dot bisht at gmail dot com Description: ------------ If conf file have something like on= Then it throws warning php: PHP Warning: syntax error, unexpected BOOL_TRUE in test.conf on line 4#012 in /tmp/test.php on line 2 Test script: --------------- $ cat test.conf [data] test=test abc=abc on=test $ cat test.php <?php $conf=parse_ini_file("test.conf",true); print_r($conf); ?> $php test.php Not printing anything.But getting this warning php: PHP Warning: syntax error, unexpected BOOL_TRUE in test.conf on line 4#012 in /tmp/test.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68461&edit=1

« previous php.bugs (#232513) next »