Skip to content

Sanitize superglobal reads in AdminScreenResolver#35

Merged
alexstandiford merged 1 commit into
mainfrom
fix/sanitize-superglobal-reads
Jun 11, 2026
Merged

Sanitize superglobal reads in AdminScreenResolver#35
alexstandiford merged 1 commit into
mainfrom
fix/sanitize-superglobal-reads

Conversation

@alexstandiford

Copy link
Copy Markdown
Contributor

Routes the four raw $_REQUEST reads through sanitize_key(wp_unslash(...)) via a shared helper; non-string values resolve to null. Package test suite green (59 tests). Fixes #34.

Surfaced by Siren's WordPress.org review simulation; flagged as a sibling of a real review finding.

isCurrentScreen/isCurrentAction/getCurrentScreen/getCurrentAction read
$_REQUEST raw — no wp_unslash, no sanitization. Route them through a
shared readRequestKey() helper using sanitize_key(wp_unslash(...)),
mirroring how core treats the page query arg. Non-string values now
resolve to null instead of leaking arrays into comparisons.

Fixes #34
@alexstandiford alexstandiford merged commit e407183 into main Jun 11, 2026
1 check passed
@alexstandiford alexstandiford deleted the fix/sanitize-superglobal-reads branch June 11, 2026 14: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.

Sanitize raw superglobal reads in AdminScreenResolver and translate's HeaderLanguageProvider

1 participant