[PCP] Phase 3: EscapeOutput.UnsafePrintingFunction + OutputNotEscaped#238
Open
faisalahammad wants to merge 1 commit into
Open
[PCP] Phase 3: EscapeOutput.UnsafePrintingFunction + OutputNotEscaped#238faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
Escape all _e(), _ex(), and bare echo in classic-editor.php: - _e() → esc_html_e() (11 locations) - _ex() → echo esc_html_x() (3 locations) - echo $clear → echo esc_html( $clear ) (1 location)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix:
WordPress.Security.EscapeOutput(lines 433–524, 698, 1011)Changes
_e()→esc_html_e(): 8 locations (lines 457, 461, 487, 503, 507, 520, 523, 524, 698)_ex()→echo esc_html_x(): 3 locations (lines 433, 437, 511, 515) — note:_ex()prints directly;esc_html_x()returns, soechoprefix requiredecho $clear→echo esc_html( $clear ): 1 location (line 1011)All replacements use
esc_html_*variants because the output contexts are HTML text nodes (labels, headings, descriptions, anchor text).Rule codes
WordPress.Security.EscapeOutput.UnsafePrintingFunction(lines 433, 437, 457, 461, 487, 503, 507, 511, 515, 520, 523, 524, 698)WordPress.Security.EscapeOutput.OutputNotEscaped(line 1011)Verification
WordPressstandard: zero violations forEscapeOutput