#44609 [Asn]: parse_ini_file 'dollar'-sign problems

From: Date: Thu, 03 Apr 2008 13:49:30 +0000
Subject: #44609 [Asn]: parse_ini_file 'dollar'-sign problems
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123923@lists.php.net to get a copy of this message
ID: 44609 User updated by: sander at procurios dot nl Reported By: sander at procurios dot nl Status: Assigned Bug Type: Filesystem function related Operating System: Mac OS X PHP Version: 5.3CVS-2008-04-02 (snap) Assigned To: helly New Comment: I am not sure I understand what you are saying. Are you telling me that we are no longer allowed to use "$4" (or anything else that matches your pattern) in our INI files? That would be a major change, since the "Expected result" I posted was output that I got from executing the exact same code on PHP 5.2.5 Previous Comments: ------------------------------------------------------------------------ [2008-04-03 13:29:19] scottmac@php.net I did the ini changes and the syntax is the same as before apart from adding null to the disallowed characters. LITERAL_DOLLAR ("$"([^a-zA-Z0-9{\000]|("\\"{ANY_CHAR}))) So $4 is what is invalid in the test. ------------------------------------------------------------------------ [2008-04-03 11:14:43] jani@php.net Marcus, another "works before re2c" bug. ------------------------------------------------------------------------ [2008-04-02 12:32:51] sander at procurios dot nl Description: ------------ Parse_ini_file gives a syntax error on 'dollar'-sign in INI-file. Source: php5.3-200804021030.tar.gz (Built on: Apr 02, 2008 10:30 UTC) Reproduce code: --------------- <?php // Set ini file location $iniFileLocation = dirname(__FILE__) . '/test.ini'; // Build ini data $iniData = '[database] db_user = username db_pass = "$@Yb^0P%$4$*" db_name = database db_host = localhost'; // Save ini data to file file_put_contents($iniFileLocation, $iniData); print_r(parse_ini_file($iniFileLocation)); Expected result: ---------------- Array ( [db_user] => username [db_pass] => $@Yb^0P%$4$* [db_name] => database [db_host] => localhost ) Actual result: -------------- Warning: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in /data/www/test.ini on line 3 in /data/www/test.php on line 15 Array ( [db_user] => username ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44609&edit=1

« previous php.bugs (#123923) next »