]> granicus.if.org Git - php/commitdiff
- Fixed bug #49056 (parse_ini_file() regression in 5.3.0 when using non-ASCII strings...
authorJani Taskinen <jani@php.net>
Tue, 4 Aug 2009 02:34:04 +0000 (02:34 +0000)
committerJani Taskinen <jani@php.net>
Tue, 4 Aug 2009 02:34:04 +0000 (02:34 +0000)
NEWS
Zend/zend_ini_scanner.l
ext/standard/tests/general_functions/bug49056.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 8c129c1dbdefb0eff29915f57fb64df6f4949903..ece156c4ef42f6aacf7b05f9f0f1cf288e63ba50 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,8 @@ PHP                                                                        NEWS
   Zend extensions). (Stas)
 - Fixed bug #49064 (--enable-session=shared does not work: undefined symbol:
   php_url_scanner_reset_vars). (Jani)
+- Fixed bug #49056 (parse_ini_file() regression in 5.3.0 when using non-ASCII
+  strings as option keys). (Jani)
 - Fixed bug #49052 (context option headers freed too early when using
   --with-curlwrappers). (Jani)
 - Fixed bug #49032 (SplFileObject::fscanf() variables passed by reference).
index c6ff0784e7ffad8738c1ee29f017d5a6c35a1c94..ac1ac76ac2ea4c0957915b9108d5e884e4552c3c 100644 (file)
@@ -308,7 +308,7 @@ NEWLINE     ("\r"|"\n"|"\r\n")
 TABS_AND_SPACES [ \t]
 WHITESPACE [ \t]+
 CONSTANT [a-zA-Z][a-zA-Z0-9_]*
-LABEL [a-zA-Z0-9*._-]*
+LABEL [^=\n\r\t ;|&$~(){}!"\[]+
 TOKENS [:,.\[\]"'()|^&+-/*=%$!~<>?@{}]
 OPERATORS [&|~()!]
 DOLLAR_CURLY "${"
diff --git a/ext/standard/tests/general_functions/bug49056.phpt b/ext/standard/tests/general_functions/bug49056.phpt
new file mode 100644 (file)
index 0000000..208766c
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+Bug #49056 (parse_ini_*() regression in 5.3.0 when using non-ASCII strings as option keys)
+--FILE--
+<?php
+
+$string = <<<EOT
+Cooking_furniture="Küchen Möbel (en)"
+Küchen_Möbel="Cooking furniture (en)"
+EOT;
+
+$filename = dirname(__FILE__) . '/bug49056.tmp';
+
+file_put_contents( $filename, $string);
+
+var_dump(parse_ini_file($filename));
+
+?>
+--CLEAN--
+<?php @unlink(dirname(__FILE__) . '/bug49056.tmp'); ?>
+--EXPECT--
+array(2) {
+  ["Cooking_furniture"]=>
+  string(23) "Küchen Möbel (en)"
+  ["Küchen_Möbel"]=>
+  string(22) "Cooking furniture (en)"
+}