Skip to content

[pull] master from php:master#730

Merged
pull[bot] merged 2 commits intodolfly:masterfrom
php:master
May 2, 2026
Merged

[pull] master from php:master#730
pull[bot] merged 2 commits intodolfly:masterfrom
php:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 2, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Girgias and others added 2 commits May 2, 2026 15:37
These changes are based on a previous PR by @ndossche to reduce codebloat: #18436

For zend_parse_arg_str_weak() we can return a `zend_string*` directly, as errors can be indicated by a NULL pointer return.

For zend_parse_arg_double_weak() we can return a `double` directly, as we can represent ZPP errors via `NAN` as booleans and integers never coerce to NAN. One might think that the string `'NAN'` can be coerced to double `NAN`, however PHP doesn't allow this coercion. And an explicit cast to double via `(float)` of such a string results in 0.

For zend_parse_arg_bool_weak() we instead create a new enum zpp_parse_bool_status that represents a tri-state which we return. Allowing us to return the boolean value via the return type instead of using an out pointer.
Extract php_is_valid_samesite_value() in ext/standard/head.c as a
shared validation function that enforces the SameSite whitelist
(Strict, Lax, None, or empty string) with case-insensitive matching.

Apply validation in both setcookie()/setrawcookie() (replacing the
existing TODO comment) and the session.cookie_samesite INI handler.
Previously arbitrary strings including CRLF sequences were accepted
and appended verbatim into the Set-Cookie header.
@pull pull Bot locked and limited conversation to collaborators May 2, 2026
@pull pull Bot added the ⤵️ pull label May 2, 2026
@pull pull Bot merged commit c130d42 into dolfly:master May 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants