lbarnaud Sun Aug 17 21:51:37 2008 UTC Modified files: /ZendEngine2 zend_ini_scanner.l /php-src/ext/standard/tests/general_functions parse_ini_file.phpt Log: Allow underscore at start of labels as underscore has no meaning here (fixes #44842) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini_scanner.l?r1=1.55&r2=1.56&diff_format=u Index: ZendEngine2/zend_ini_scanner.l diff -u ZendEngine2/zend_ini_scanner.l:1.55 ZendEngine2/zend_ini_scanner.l:1.56 --- ZendEngine2/zend_ini_scanner.l:1.55 Sun Aug 17 20:57:34 2008 +++ ZendEngine2/zend_ini_scanner.l Sun Aug 17 21:51:36 2008 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_ini_scanner.l,v 1.55 2008/08/17 20:57:34 lbarnaud Exp $ */ +/* $Id: zend_ini_scanner.l,v 1.56 2008/08/17 21:51:36 lbarnaud Exp $ */ #include <errno.h> #include "zend.h" @@ -312,7 +312,7 @@ TABS_AND_SPACES [ \t] WHITESPACE [ \t]+ CONSTANT [a-zA-Z][a-zA-Z0-9_]* -LABEL [a-zA-Z0-9][a-zA-Z0-9._-]* +LABEL [a-zA-Z0-9_][a-zA-Z0-9._-]* TOKENS [:,.\[\]"'()|^&+-/*=%$!~<>[EMAIL PROTECTED] OPERATORS [&|~()!] DOLLAR_CURLY "${" http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/parse_ini_file.phpt?r1=1.6&r2=1.7&diff_format=u Index: php-src/ext/standard/tests/general_functions/parse_ini_file.phpt diff -u php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.6 php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.7 --- php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.6 Tue May 27 00:04:31 2008 +++ php-src/ext/standard/tests/general_functions/parse_ini_file.phpt Sun Aug 17 21:51:36 2008 @@ -94,6 +94,15 @@ file_put_contents($filename, $ini); var_dump(parse_ini_file($filename, true)); +/* #44842, labels starting with underscore */ +$ini = <<<'INI' +foo=bar1 +_foo=bar2 +foo_=bar3 +INI; +file_put_contents($filename, $ini); +var_dump(parse_ini_file($filename, true)); + @unlink($filename); echo "Done\n"; ?> @@ -182,4 +191,12 @@ unicode(5) "value" } } +array(3) { + [u"foo"]=> + unicode(4) "bar1" + [u"_foo"]=> + unicode(4) "bar2" + [u"foo_"]=> + unicode(4) "bar3" +} Done
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php