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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 10:01:28 2024 UTC