Re: max_input_vars trigger detection
| From: | Craig Duncan | Date: | Sun, 10 May 2020 12:34:12 +0000 |
| Subject: | Re: max_input_vars trigger detection | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110105@lists.php.net to get a copy of this message | ||
>
> Although not particularly elegant, and it does require you to reject
requests that hit but don't exceed the limit, I've used this approach
before:
$max = ini_get("max_input_vars") - 1;
$check = count($_REQUEST);
if ($check > $max) {
throw new RequestException("Request is too large, only {$max} input
variables are permitted");
}