File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,6 +189,8 @@ PHP NEWS
189189 (Weilin Du)
190190 . getenv() and putenv() now raises a ValueError when the first argument
191191 contains null bytes. (Weilin Du)
192+ . parse_str() now raises a ValueError when the $string argument contains
193+ null bytes. (Weilin Du)
192194 . proc_open() now raises a ValueError when the $cwd argument contains
193195 null bytes. (Weilin Du)
194196
Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ PHP 8.6 UPGRADE NOTES
9797 argument value is passed.
9898 . getenv() and putenv() now raises a ValueError when the first argument
9999 contains null bytes.
100+ . parse_str() now raises a ValueError when the $string argument contains
101+ null bytes.
100102 . linkinfo() now raises a ValueError when the $path argument is empty.
101103 . pathinfo() now raises a ValueError when an invalid $flag
102104 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