Skip to content

Clean up SAPI POST readers - #24057

Merged
NattyNarwhal merged 7 commits into
php:masterfrom
NattyNarwhal:sapi-post-reader-cleanup
Nov 29, 2026
Merged

NattyNarwhal merged 7 commits into
php:masterfrom
NattyNarwhal:sapi-post-reader-cleanup

Conversation

@NattyNarwhal

Copy link
Copy Markdown
Member
  • Remove the "default POST reader" as there was only ever one and the indirection is pointless.
  • Move the default list of POST readers into the generic SAPI code and make it exported, so mbstring doesn't need a copy of it.
  • Put the treat data and input filter initialization into its single caller.
  • Fold php_content_types into the generic SAPI code.

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XXX: Perhaps php_std_post_handler belongs in php_variables.h?

I think so, as it is defined in php_variables.c, could you change this? (either in this PR or a follow-up).

Note these changes should be documented in UPGRADING INTERNAL as well

@NattyNarwhal
NattyNarwhal force-pushed the sapi-post-reader-cleanup branch from 2f85190 to 27ed82d Compare November 27, 2026 18:21
There is only one of these; there's no point in the indirection here as
it is never overrode, and set very early in main.c. Move the default
post handling into the SAPI handling, and remove the pointless check if
a default POST reader exists.

This stuff was originally introduced in
98d95dd.
mbstring had a duplicate of this; remove some indirection and provide
this as a symbol so it can be switched back to w/o duplication.
All its contents have been folded elsewhere.

XXX: Perhaps php_std_post_handler belongs in php_variables.h?
@NattyNarwhal
NattyNarwhal force-pushed the sapi-post-reader-cleanup branch from 27ed82d to 58bc895 Compare November 29, 2026 05:08

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you plan on squashing the commits, it might make sense to move the "sapi: move php_std_post_handler per Gina" commit one commit prior so that the php_content_types commit is effectively removing an empty header and an empty C file.

Otherwise LGTM.

@NattyNarwhal

Copy link
Copy Markdown
Member Author

Mac failure unrelated, merging

@NattyNarwhal
NattyNarwhal merged commit e20af30 into php:master Nov 29, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants