php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49172 parse_ini_file does not like colon (:) in key
Submitted: 2009-08-05 20:27 UTC Modified: 2009-08-05 21:45 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mightymorse at gmail dot com Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 5.3.0 OS: Mac OS 10.5.5
Private report: No CVE-ID: None
 [2009-08-05 20:27 UTC] mightymorse at gmail dot com
Description:
------------
In PHP version 5.2.x, INI file keys could include colons (":").  With PHP 5.3, using a colon in an INI file key causes parse_ini_file syntax error.


===PHP configure line===
'./configure' '--disable-dependency-tracking' '--prefix=/usr/local/php5' '--with-apxs2=/usr/sbin/apxs' '--with-config-file-scan-dir=/usr/local/php5/php.d' '--with-openssl=/usr' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-gd' '--with-ldap' '--with-xmlrpc' '--enable-exif' '--enable-soap' '--enable-sqlite-utf8' '--enable-wddx' '--enable-ftp' '--enable-sockets' '--with-bz2=/usr' '--enable-zip' '--enable-pcntl' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-memory-limit' '--enable-mbstring' '--enable-bcmath' '--enable-calendar' '--with-iodbc' '--with-mhash' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv=/usr/local/php5' '--with-mssql=shared,/usr/local/php5' '--enable-memcache' '--with-imap=../imap-2007e' '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--with-libxml-dir=shared,/usr/local/php5' '--with-xsl=shared,/usr/local/php5' '--with-gettext=/usr/local/php5' '--with-curl=shared,/usr/local/php5' '--with-png-dir=/usr/local/php5' '--with-jpeg-dir=/usr/local/php5' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local/php5' '--with-pgsql=shared,/usr/local/php5' '--with-pdo-pgsql=shared,/usr/local/php5' '--with-mcrypt=shared,/usr/local/php5'

===PHP ini file===
Production ini, except for display_errors=on and short_open_tag=on


Reproduce code:
---------------
---Contents of conf.ini---
a:b=c


---Contents of test.php---
<?php
$res = parse_ini_file('conf.ini', true);
echo $res['a:b'];


Expected result:
----------------
c

Actual result:
--------------
Warning: syntax error, unexpected ':' in conf.ini on line 1 in /Library/WebServer/Documents/test_ini/test.php on line 2


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-05 21:45 UTC] jani@php.net
Already fixed in SVN. Pretty much anything is allowed now. :D
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 23 08:01:29 2024 UTC