]> granicus.if.org Git - php/commitdiff
MFB: fix #46347
authorNuno Lopes <nlopess@php.net>
Mon, 2 Feb 2009 19:25:30 +0000 (19:25 +0000)
committerNuno Lopes <nlopess@php.net>
Mon, 2 Feb 2009 19:25:30 +0000 (19:25 +0000)
Zend/zend_ini_scanner.l
ext/standard/tests/file/bug46347.phpt [new file with mode: 0644]

index 364c6e2297f4f17d50f93f31d6a5faa6af5f1364..8e28618ae579529903007a0ed69ca6ca9a5c28cd 100644 (file)
@@ -309,7 +309,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"
+}