note 126160 added to function.parse-str
| From: | kawewong at gmail dot com | Date: | Fri, 11 Jun 2021 09:11:06 +0000 |
| Subject: | note 126160 added to function.parse-str | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216510@lists.php.net to get a copy of this message | ||
Warning:
parse_str() can cause "Input variables exceeded 1000" error (1000 is
default php.ini setting for max_input_vars).
Test code.
<?php
$inputString = 'first=firstvalue';
for ($i = 1; $i <= 1100; $i++) {
$inputString .= '&arrLoopNumber[]=' . $i;
}
unset($i);
echo 'input string: <code>' . $inputString . '</code><br>' .
PHP_EOL;
echo '<h5>doing <code>parse_str()</code></h5>' . PHP_EOL;
$output = [];
parse_str($inputString, $output);
// errors!!
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 49.228.227.249)
----
Manual Page -- https://php.net/manual/en/function.parse-str.php
Edit -- https://main.php.net/note/edit/126160
Del: integrated -- https://main.php.net/note/delete/126160/integrated
Del: useless -- https://main.php.net/note/delete/126160/useless
Del: bad code -- https://main.php.net/note/delete/126160/bad+code
Del: spam -- https://main.php.net/note/delete/126160/spam
Del: non-english -- https://main.php.net/note/delete/126160/non-english
Del: in docs -- https://main.php.net/note/delete/126160/in+docs
Del: other reasons-- https://main.php.net/note/delete/126160
Reject -- https://main.php.net/note/reject/126160
Search -- https://main.php.net/manage/user-notes.php