WordPress / WordPress/WordPress-Coding-Standards
XSS: Issues with code snippet in error
Open
Nobody has claimed this yet.
Focus: Security
- Dominant language
- PHP
- Stars
- 2.8k
- Forks
- 521
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 1
Description
Split off from #744
These are a few cases where the code in the error is either shortened or too much.
WARNING | Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '$strings'where it actually was$strings['update-available']WARNING | Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '$theme'where it was$theme->get( 'Name' )WARNING | Expected next thing to be an escaping function (see Codex for 'Data Validation'), not '"<a href='$facebook_url' title='Facebook' target='_blank' class='facebook-icon'><span class='icon-social-facebook'></span></a>"'where the code is:
$facebook_url = esc_url(get_theme_mod('facebook_url', '')); echo "<a href='$facebook_url' title='Facebook' target='_blank' class='facebook-icon'><span class='icon-social-facebook'></span></a>";
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 reproducing the escaping-function warning with the three PHP examples in the issue and inspect how the warning builds its code snippet. Compare the reported snippets with the actual expressions shown in the issue. Done means the warning preserves the relevant full code without shortening or including excessive surrounding code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100