#49692 [Com]: parse_ini_file() throws errors when key contains '/' (forward slash)
| From: | rickwalker2001 at gmail dot com | Date: | Sun, 27 Sep 2009 22:43:48 +0000 |
| Subject: | #49692 [Com]: parse_ini_file() throws errors when key contains '/' (forward slash) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-142967@lists.php.net to get a copy of this message | ||
ID: 49692
Comment by: rickwalker2001 at gmail dot com
Reported By: rickwalker2001 at gmail dot com
Status: Open
Bug Type: Filesystem function related
Operating System: OS X 10.6
PHP Version: 5.3.0
New Comment:
Previous bug: http://bugs.php.net/bug.php?id=47332
Previous Comments:
------------------------------------------------------------------------
[2009-09-27 21:58:10] rickwalker2001 at gmail dot com
Description:
------------
When parsing ini files if the key contains a '/' char a syntax error is
thrown.
I have seen a bug closed as bogus from back in feb on one of the 5.3
beta versions but I am seeing this with the latest stable 5.3 build
from
macports.
PHP 5.3.0 (cli) (built: Sep 26 2009 00:08:23)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans
Reproduce code:
---------------
//my.ini file
[sitemap]
/home = default:index
/info = default:info
print_r(parse_ini_file('my.ini', true));
Expected result:
----------------
Array
(
[sitemap] => Array
(
[/home] => default:index
[/info] => default:info
)
)
Actual result:
--------------
PHP Warning: syntax error, unexpected '/' in my.ini on line 2
in /Users/rick/test.php on line 5
PHP Stack trace:
PHP 1. {main}() /Users/rick/test.php:0
PHP 2. parse_ini_file() /Users/rick/test.php:5
Warning: syntax error, unexpected '/' in my.ini on line 2
in /Users/rick/test.php on line 5
Call Stack:
0.0004 622136 1. {main}() /Users/rick/test.php:0
0.0004 622312 2. parse_ini_file() /Users/rick/test.php:5
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49692&edit=1