Re: Error behaviour for max_input_vars
| From: | Thomas Nunninger | Date: | Wed, 14 Sep 2022 14:44:33 +0000 |
| Subject: | Re: Error behaviour for max_input_vars | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118623@lists.php.net to get a copy of this message | ||
Hi,
In summary, I believe this can only be solved inside of PHP itself, by allowing to configure a way forI'd prefer that PHP aborts such requests. Then data loss/inconsistency is prevented for everybody and people can fix their applications. (So no need for an ini setting that allows acting in "danger mode".) If you'd like to give developers more options to choose from, I'd go for max_input_vars_abort (default 1) plus has_post_been_truncated(): That way the behavior is safe from the start. And people who opt in for "danger mode" can reliably detect if there was some data loss and can deal with it. Regards Thomasmax_input_varsto abort the request instead of truncating the input. The options I see feasible are: - A new ini settingmax_input_vars_abort(default to 0), which, if set to 1, will abort the request if there are more input variables than allowed. - A method to reliably detect whether the input vars were truncated (eg.function has_post_been_truncated(): bool), so the application can decide whether to abort or not. - Deciding thatmax_input_varsis not relevant anymore and should be handled by the likes of Apache and NGINX, thus changing the default to0and removing the settingover a deprecation period.I am leaning towards the first option, but would be open to either outcome.