|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-04-02 12:32 UTC] 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
)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 23:00:01 2025 UTC |
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.