Skip to content

Pass explicit character lists to trim() calls#2140

Merged
mnapoli merged 1 commit into
brefphp:masterfrom
GrahamCampbell:explicit-trim-chars
Jul 9, 2026
Merged

Pass explicit character lists to trim() calls#2140
mnapoli merged 1 commit into
brefphp:masterfrom
GrahamCampbell:explicit-trim-chars

Conversation

@GrahamCampbell

@GrahamCampbell GrahamCampbell commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Relying on trim()'s default character list is undesirable: it is broader than the whitespace HTTP allows, and the default has changed in PHP 8.6, causing inconsistent behaviour. This passes an explicit list at every call site, narrowing header parsing to RFC 7230 OWS and pinning current behaviour elsewhere.

@mnapoli

mnapoli commented Jul 9, 2026

Copy link
Copy Markdown
Member

Thanks!

@mnapoli mnapoli merged commit 34ef49e into brefphp:master Jul 9, 2026
8 checks passed
@GrahamCampbell GrahamCampbell deleted the explicit-trim-chars branch July 9, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants