php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48660 parse_ini_*(): dollar sign as last character of value fails
Submitted: 2009-06-23 13:54 UTC Modified: 2009-08-07 14:23 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: marek dot nos at skype dot net Assigned: jani (profile)
Status: Closed Package: PHP options/info functions
PHP Version: 5.3, 6 (2009-08-04) OS: *
Private report: No CVE-ID: None
 [2009-06-23 13:54 UTC] marek dot nos at skype dot net
Description:
------------
This is quite similar to #44609. Probably still not properly fixed.

Reproduce code:
---------------
<?php
// Set ini file location
$ini_location = dirname(__FILE__) . '/test.ini';

// Build ini data
$ini_data = '
[cases]

Case.a = avalue
Case.b = "$dollar_sign$"
Case.c = 10
';

// Save ini data to file
file_put_contents($ini_location, $ini_data);

var_dump(parse_ini_file('test.ini'));
?>



Expected result:
----------------
array(3) {
  ["Case.a"]=>
  string(6) "avalue"
  ["Case.b"]=>
  string(13) "$dollar_sign$"
  ["Case.c"]=>
  string(2) "10"
}

Actual result:
--------------
Warning:  syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in test.ini on line 5
 in C:\Users\Marek Nos\Documents\workspace\parse_ini.php on line 17
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-07 14:21 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=286908
Log: - Fixed bug #48660 (parse_ini_*(): dollar sign as last character of value fails)
 [2009-08-07 14:23 UTC] jani@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC