Skip to content

Fix GH-24697: cli: passing PHP_HTTP_PARSER_STRICT build option doesn't work - #24704

Closed
ndossche wants to merge 2 commits into
php:PHP-8.4from
ndossche:fix-24697
Closed

ndossche wants to merge 2 commits into
php:PHP-8.4from
ndossche:fix-24697

Conversation

@ndossche

Copy link
Copy Markdown
Member

The default is non-strict, we need to keep the default for BC reasons. We change the macro handling such that it can be enabled now, previously it couldn't be enabled.

…sn't work

The default is non-strict, we need to keep the default for BC reasons.
We change the macro handling such that it can be enabled now, previously
it couldn't be enabled.
@ndossche ndossche linked an issue Oct 25, 2026 that may be closed by this pull request
@ndossche
ndossche requested a review from devnexen October 25, 2026 23:09
@devnexen

Copy link
Copy Markdown
Member

I think you need to do this change too

diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index xxxxxxx..yyyyyyy 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -244,7 +244,7 @@
 #define start_state (parser->type == PHP_HTTP_REQUEST ? s_start_req : s_start_res)


-#ifdef HTTP_PARSER_STRICT
+#if PHP_HTTP_PARSER_STRICT
 # define STRICT_CHECK(cond) if (cond) goto error
 # define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead)
 #else

Co-authored-by: David Carlier <devnexen@gmail.com>
@ndossche

Copy link
Copy Markdown
Member Author

Yeah, you're right, fixed

@ndossche ndossche closed this in 470af31 Oct 26, 2026
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.

cli: passing PHP_HTTP_PARSER_STRICT build option doesn't work

2 participants