#41445 [NEW]: parse_ini_file function has a problem with certain types of integer as sections
| From: | dcox at conxxus dot com | Date: | Sat, 19 May 2007 22:42:46 +0000 |
| Subject: | #41445 [NEW]: parse_ini_file function has a problem with certain types of integer as sections | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-112864@lists.php.net to get a copy of this message | ||
From: dcox at conxxus dot com
Operating system: linux 2.4.32
PHP version: 5.2.2
PHP Bug Type: PHP options/info functions
Bug description: parse_ini_file function has a problem with certain types of integer as sections
Description:
------------
I stumbled across this when storing MAC configuration in an INI file.
When the MAC address (length=12) had all numbers and started with "00"
then the MAC would not be stored as a section correctly.
Reproduce code:
---------------
<?php
$options = parse_ini_file("test.ini", TRUE);
print_r($options);
?>
-- test.ini --
[001099030277]
option1 = yes
[011099030277]
option2 = yes
Expected result:
----------------
Array
(
[001099030277] => Array
(
[option1] => 1
)
[011099030277] => Array
(
[option2] => 1
)
)
Actual result:
--------------
Array
(
[8] => Array
(
[option1] => 1
)
[011099030277] => Array
(
[option2] => 1
)
)
--
Edit bug report at http://bugs.php.net/?id=41445&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41445&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41445&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41445&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41445&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41445&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41445&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41445&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41445&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41445&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41445&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41445&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41445&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41445&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41445&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41445&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41445&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41445&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41445&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41445&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41445&r=mysqlcfg