WordPress / WordPress/WordPress-Coding-Standards
Calling ctype_alnum should count as sanitized input
Open
Nobody has claimed this yet.
Focus: Security
Type: Enhancement
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
if ( !empty( $_POST['hello'] ) && ctype_alnum( $_POST['hello'] ) ) {
$hello = $_POST['hello'];
}
Atm it's reported as WordPress.Security.ValidatedSanitizedInput
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the WordPress.Security.ValidatedSanitizedInput sniff or its tests in the WordPress-Coding-Standards repository, then reproduce the issue with the provided ctype_alnum example. Done means valid ctype_alnum checks are no longer reported as unsanitized input and existing sniff behavior remains covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100