Form parsing fails if last value contains a urlencoded &
brstgt opened this issue · 3 comments
brstgt commented
foreach (\explode("&", $body, $this->fieldCountLimit) as $pair) {
$pair = \explode("=", $pair, 2);
$field = \urldecode($pair[0]);
$value = \urldecode($pair[1] ?? "");
$fields[$field][] = $value;
}
#Wrong
if (\strpos($value ?? "", "&") !== false) {
throw new ParseException("Maximum number of variables exceeded");
}
#Right
if (\strpos($$pair[1] ?? "", "&") !== false) {
kelunik commented
Thanks! Do you want to provide that as a PR?
brstgt commented
Sorry, was pretty busy so i was not able to provide a PR quickly. Thanks!
kelunik commented
Dont worry, thanks again for the report!