php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44544 parse_ini_file() parsing error with character '$'
Submitted: 2008-03-27 04:00 UTC Modified: 2009-08-07 14:34 UTC
From: frederes at free dot fr Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 5.2.6RC2 OS: Gentoo 2006
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: frederes at free dot fr
New email:
PHP Version: OS:

 

 [2008-03-27 04:00 UTC] frederes at free dot fr
Description:
------------
when character '$' is present in a value string , parse_ini_file() return a warning/error and cut the value string before the $
so data result is wrong !

Reproduce code:
---------------
<?php
$ini_array = parse_ini_file("test.ini");
print_r($ini_array);
?>

test.ini file content :

toto = aaa$bbb

Expected result:
----------------
Array ( [toto] => aaa$bbb)

Actual result:
--------------
Warning: Error parsing test.ini on line 8 in parse_ini.php on line 2
Array ( [toto] => aaa)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-27 09:40 UTC] jani@php.net
Fixed in HEAD/PHP_5_3, won't fix in PHP_5_2, use quotes instead (as you ALWAYS should anyway):

toto = "aaa$bbb"
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Mar 13 01:01:31 2025 UTC