[php-src] PR #25770: Reset skip_upload per part in rfc1867_post_handler()
| From: | hohphu8 | Date: | Thu, 26 Nov 2026 04:27:06 +0000 |
| Subject: | [php-src] PR #25770: Reset skip_upload per part in rfc1867_post_handler() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41030@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25770
Author: hohphu8
In
rfc1867_post_handler() (main/rfc1867.c), skip_upload is
declared outside the multipart while loop and never reset. Once a file part triggers
it, for example a field name with malformed brackets such as name="bad[",
every later file part in the same request is skipped as well, while later non-file fields are still
parsed into $_POST.
This moves skip_upload into the loop body so it is evaluated per part. The
!PG(file_uploads) and upload_cnt <= 0 branches set it again on each
iteration, so their behavior is unchanged.
Adds tests/basic/rfc1867_malformed_bracket_skip_upload.phpt: a malformed file part
followed by a valid one and a plain field. It fails before the fix ($_FILES is empty)
and passes after.
Note: I found this through source inspection with an automated/LLM-assisted tool, then reproduced
and verified it myself.