Skip to content

Commit f42d7bd

Browse files
committed
Fixed bug #76965 INI_SCANNER_RAW doesn't strip trailing whitespace
1 parent 47b89bc commit f42d7bd

File tree

4 files changed

+140
-86
lines changed

4 files changed

+140
-86
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ PHP NEWS
2222
- intl:
2323
. Fixed bug #76942 (U_ARGUMENT_TYPE_MISMATCH). (anthrax at unixuser dot org)
2424

25+
- Standard:
26+
. Fixed bug #76965 (INI_SCANNER_RAW doesn't strip trailing whitespace).
27+
(Pierrick)
28+
2529
11 Oct 2018, PHP 7.1.23
2630

2731
- Core:

Zend/tests/bug76965.phpt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--TEST--
2+
Bug #76965 (INI_SCANNER_RAW doesn't strip trailing whitespace)
3+
--FILE--
4+
<?php
5+
// the trailing whitespace is intentional
6+
$ini = <<<END
7+
1="foo"
8+
2="bar" ; comment
9+
3= baz
10+
4= "foo;bar"
11+
5= "foo" ; bar ; baz
12+
6= "foo;bar" ; baz
13+
7= foo"bar ; "ok
14+
END;
15+
16+
var_dump(parse_ini_string($ini, false, INI_SCANNER_RAW));
17+
?>
18+
===DONE===
19+
--EXPECT--
20+
array(7) {
21+
[1]=>
22+
string(3) "foo"
23+
[2]=>
24+
string(3) "bar"
25+
[3]=>
26+
string(3) "baz"
27+
[4]=>
28+
string(7) "foo;bar"
29+
[5]=>
30+
string(3) "foo"
31+
[6]=>
32+
string(7) "foo;bar"
33+
[7]=>
34+
string(7) "foo"bar"
35+
}
36+
===DONE===

0 commit comments

Comments
 (0)