ID: 48719
Updated by: [email protected]
Reported By: dragoonis at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Unknown/Other Function
Operating System: All
PHP Version: 5.3.0RC4
-Assigned To:
+Assigned To: kalle
Previous Comments:
------------------------------------------------------------------------
[2009-06-29 13:15:59] dragoonis at gmail dot com
Changed OS to 'All'
------------------------------------------------------------------------
[2009-06-29 13:13:02] dragoonis at gmail dot com
Description:
------------
The sanitation on the new parse_ini_file parameter names scanner mode
doesn't check if a valid scanner mode has been passed.
The patch has been applied below the if() for if (filename_len == 0)
{.
The fix can be found here:
http://digiflexdev.com/php/parse_ini_file_fix.txt
The .phpt file for this is below
http://digiflexdev.com/php/parse_ini_file_test.txt
I realise the .phpt file is wrong somewhat this is my first bug report
and the .phpt file just shows.
The same issue applies to parse_ini_string, respectively.
Reproduce code:
---------------
<?php print_r(parse_ini_file('file.ini', false',
INVALID_SCANNER_MODE));
Make a file named file.ini with the following in it.
data = 2
Expected result:
----------------
I'd expect to see a notice. and default to ZEND_INI_SCANNER_NORMAL
which is what my fix does.
Actual result:
--------------
Warning: parse_ini_file() expects parameter 3 to be long, string given
in /home/pdragoonis/php-5.3.0/sapi/cli/pd/parse_ini_file_test.php on
line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48719&edit=1