php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #15006 parse_ini_file barfs when seeing ~ (hex 7E)
Submitted: 2002-01-12 12:37 UTC Modified: 2002-06-04 19:23 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: jfh at adr dot dk Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.1.0 OS: Linux 2.4.12
Private report: No CVE-ID: None
 [2002-01-12 12:37 UTC] jfh at adr dot dk
The error can be reproduced by creating the following file:

[test]
   foo = bar~

and then running it through parse_ini_file.

This produces the following error:

Warning: Error parsing temp.ini on line 2 in Unknown on line 0

Using Debian Testing with PHP package version 4.0.100-1.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-05 13:20 UTC] me at watson1999-69 dot freeserve dot co dot uk
parse_ini_file also breaks when seeing ", even if this is escaped (same error message). This also happens on PHP/4.11, Win98SE.
 [2002-06-04 16:51 UTC] richard@php.net
And also on ! (exclamation mark)
 [2002-06-04 18:35 UTC] edink@php.net
If you have any "funny characters" on the right hand side of = you need to put them under double quotes "".

Marking this as a documentation problem.
 [2002-06-04 19:23 UTC] edink@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 [2002-09-03 15:46 UTC] rst at bdc dot no
I still get the an error, even if I put the "funny characters" on the right hand side of = under double quotes "". I have tested on "(" and a "=".
 [2003-05-02 08:47 UTC] grin at gmx dot net
parse_ini_file does still not work. If you try to use the "~" 
character (for your home directory, for example), the whole 
value of the field is set to "-1". 
 
This still is not done. Please reopen and fix it.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 05 22:01:30 2025 UTC