summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--Zend/zend_ini_scanner.l2
-rw-r--r--ext/standard/tests/file/bug46347.phpt24
3 files changed, 26 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 0f6a048255..1d53965918 100644
--- 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
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index 69ae5f647d..70477a5644 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -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
index 0000000000..903a6e35cc
--- /dev/null
+++ b/ext/standard/tests/file/bug46347.phpt
@@ -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"
+}