]> granicus.if.org Git - php/commitdiff
fix bug #46347: allow * in ini keys
authorNuno Lopes <nlopess@php.net>
Mon, 2 Feb 2009 19:23:13 +0000 (19:23 +0000)
committerNuno Lopes <nlopess@php.net>
Mon, 2 Feb 2009 19:23:13 +0000 (19:23 +0000)
NEWS
Zend/zend_ini_scanner.l
ext/standard/tests/file/bug46347.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 0f6a0482552c526beb444a069b1b0b4f54e2bb55..1d53965918b8d2ee314e53ca0a5bc31920486664 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2009, PHP 5.3.0 Beta 2
 - Fixed bug #47229 (preg_quote() should escape the '-' char). (Nuno)
+- Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
 
 
 29 Jan 2009, PHP 5.3.0 Beta 1
index 69ae5f647de25e9bc83d15d726d79c303f5da103..70477a56448d9e72a2e2363a926eeb828efb6d12 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_][a-zA-Z0-9._-]*
+LABEL [a-zA-Z0-9_][a-zA-Z0-9*._-]*
 TOKENS [:,.\[\]"'()|^&+-/*=%$!~<>?@{}]
 OPERATORS [&|~()!]
 DOLLAR_CURLY "${"
diff --git a/ext/standard/tests/file/bug46347.phpt b/ext/standard/tests/file/bug46347.phpt
new file mode 100644 (file)
index 0000000..903a6e3
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+Bug #46347 (parse_ini_file() doesn't support * in keys)
+--FILE--
+<?php
+
+$str = <<< EOF
+[section]
+part1.*.part2 = 1
+EOF;
+
+$file = __DIR__ . '/parse.ini';
+file_put_contents($file, $str);
+
+var_dump(parse_ini_file($file));
+?>
+--CLEAN--
+<?php
+unlink(__DIR__.'/parse.ini');
+?>
+--EXPECT--
+array(1) {
+  ["part1.*.part2"]=>
+  string(1) "1"
+}