Skip to content

header() RFC 9110/9112 validations - #25721

Open
narfbg wants to merge 2 commits into
php:masterfrom
narfbg:header_validation
Open

narfbg wants to merge 2 commits into
php:masterfrom
narfbg:header_validation

Conversation

@narfbg

@narfbg narfbg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Closes GH-19858

Also includes minor cleanup/optimizations and fixes potential locale-related issues in sapi_header_op(). I'll probably split those into a separate PR later and rebase this one.

Comment thread main/SAPI.c
if (len == 5 && *response_code) {
return true;
}
if (len < 8 || line[5] < '1' || line[5] > '9' || line[6] != '.' || !ZEND_IS_DIGIT(line[7])) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The .x being a must is actually only valid for 1.x, whereas 2/3 don't use the same headers mechanics at all. I guess a future protocol version might ... ? I may've gone overboard with it.

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.

Inconsistent handling of invalid headers causes unexpected behavior

1 participant