path: root/ext
diff options
authorPierrick Charron <>2012-06-07 15:44:20 (GMT)
committerPierrick Charron <>2012-06-07 15:44:20 (GMT)
commitfed5923dbc849659321a4f9aa96634ddd1655229 (patch)
tree6751ff170cefadd29e152717651f88032fe0cdfb /ext
parentc56ff39c05be5b846973760ef8bdad8401defe24 (diff)
Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)
Modify the scanner to check if the first char of the raw data is an opening " in which case we need to find the closing one. Otherwise just search for the next end of value char [\r\n;\000]
Diffstat (limited to 'ext')
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug51094.phpt b/ext/standard/tests/file/bug51094.phpt
new file mode 100644
index 0000000..7823558
--- /dev/null
+++ b/ext/standard/tests/file/bug51094.phpt
@@ -0,0 +1,22 @@
+Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon).
+$ini = parse_ini_string('ini="ini;raw"', null, INI_SCANNER_RAW);
+$ini = parse_ini_string('ini="ini;raw', null, INI_SCANNER_RAW);
+$ini = parse_ini_string('ini=ini;raw', null, INI_SCANNER_RAW);
+$ini = parse_ini_string('ini=ini"raw', null, INI_SCANNER_RAW);
+$ini = parse_ini_string("ini=\r\niniraw", null, INI_SCANNER_RAW);
+string(7) "ini;raw"
+string(8) ""ini;raw"
+string(3) "ini"
+string(7) "ini"raw"
+string(0) ""