lbarnaud                Sun Aug 17 21:55:27 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src    NEWS 
    /ZendEngine2        zend_ini_scanner.l 
    /php-src/ext/standard/tests/general_functions       parse_ini_file.phpt 
  Log:
  MFH: Allow underscore at start of labels as underscore has no meaning here
  (fixes #44842)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.275&r2=1.2027.2.547.2.965.2.276&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.275 
php-src/NEWS:1.2027.2.547.2.965.2.276
--- php-src/NEWS:1.2027.2.547.2.965.2.275       Sun Aug 17 21:00:21 2008
+++ php-src/NEWS        Sun Aug 17 21:55:26 2008
@@ -38,6 +38,8 @@
   newline). (Arnaud)
 - Fixed bug #45044 (relative paths not resolved correctly). (Dmitry)
 - Fixed bug #44925 (preg_grep() modifies input array). (Nuno)
+- Fixed bug #44842 (parse_ini_file keys that start/end with underscore). 
+  (Arnaud)
 - Fixed bug #44100 (Inconsistent handling of static array declarations with
   duplicate keys). (Dmitry)
 - Fixed bug #43817 (opendir() fails on Windows directories with parent
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini_scanner.l?r1=1.41.2.2.2.2.2.9&r2=1.41.2.2.2.2.2.10&diff_format=u
Index: ZendEngine2/zend_ini_scanner.l
diff -u ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.2.2.9 
ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.2.2.10
--- ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.2.2.9     Sun Aug 17 21:00:22 2008
+++ ZendEngine2/zend_ini_scanner.l      Sun Aug 17 21:55:26 2008
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.2.2.9 2008/08/17 21:00:22 lbarnaud Exp 
$ */
+/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.2.2.10 2008/08/17 21:55:26 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.1.2.2.2.2&r2=1.1.2.2.2.3&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.1.2.2.2.2 
php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.1.2.2.2.3
--- 
php-src/ext/standard/tests/general_functions/parse_ini_file.phpt:1.1.2.2.2.2    
    Tue Apr  8 12:33:54 2008
+++ php-src/ext/standard/tests/general_functions/parse_ini_file.phpt    Sun Aug 
17 21:55:26 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 @@
     string(5) "value"
   }
 }
+array(3) {
+  ["foo"]=>
+  string(4) "bar1"
+  ["_foo"]=>
+  string(4) "bar2"
+  ["foo_"]=>
+  string(4) "bar3"
+}
 Done



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to