File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,6 +191,8 @@ PHP NEWS
191191 (Weilin Du)
192192 . getenv() and putenv() now raises a ValueError when the first argument
193193 contains null bytes. (Weilin Du)
194+ . parse_str() now raises a ValueError when the $string argument contains
195+ null bytes. (Weilin Du)
194196 . proc_open() now raises a ValueError when the $cwd argument contains
195197 null bytes. (Weilin Du)
196198
Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ PHP 8.6 UPGRADE NOTES
9999 argument value is passed.
100100 . getenv() and putenv() now raises a ValueError when the first argument
101101 contains null bytes.
102+ . parse_str() now raises a ValueError when the $string argument contains
103+ null bytes.
102104 . linkinfo() now raises a ValueError when the $path argument is empty.
103105 . pathinfo() now raises a ValueError when an invalid $flag
104106 argument value is passed.
Original file line number Diff line number Diff line change @@ -5012,7 +5012,7 @@ PHP_FUNCTION(parse_str)
50125012 size_t arglen ;
50135013
50145014 ZEND_PARSE_PARAMETERS_START (2 , 2 )
5015- Z_PARAM_STRING (arg , arglen )
5015+ Z_PARAM_PATH (arg , arglen )
50165016 Z_PARAM_ZVAL (arrayArg )
50175017 ZEND_PARSE_PARAMETERS_END ();
50185018
Original file line number Diff line number Diff line change 1+ --TEST--
2+ parse_str() rejects null bytes
3+ --FILE--
4+ <?php
5+
6+ try {
7+ parse_str ("a=1 \0&b=2 " , $ result );
8+ } catch (ValueError $ e ) {
9+ echo $ e ->getMessage (), "\n" ;
10+ }
11+
12+ ?>
13+ --EXPECT--
14+ parse_str(): Argument #1 ($string) must not contain any null bytes
You can’t perform that action at this time.
0 commit comments