-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding missing escaping check for <?=
#858
Closed
david-binda
wants to merge
20
commits into
WordPress:develop
from
david-binda:fix-857/report-missing-escaping-on-php-echo-shorthand-tag
+64
−2
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f8241bc
Adding missing escaping check for `<?=`
david-binda 98df766
Add missing PHP closing tag in the XSS/EscapeOutputUnitTest.inc file …
david-binda a31b188
Replacing PHP comments for HTML ones in XSS/EscapeOutputUnitTest.inc
david-binda 3fcbdc7
Add regext fallback support for collecting some obvious unescaped sho…
david-binda 37dfe31
Adding specific case to the matrix for running the tests on PHP 5.3 w…
david-binda e7d7477
Adding proper check for deciding on whether short_open_tag is disable…
david-binda fac73b2
Language improvements in comments per feedback
david-binda 73fd553
Removing debug code
david-binda 415a8b1
Removing the `is_short_open_tag_enabled` method
david-binda 5b6e892
Replace the `phpversion` and `version_compare` function calls by PHP_…
david-binda ba862f9
Improving the regex used in a fallback in case open_short_tag is disa…
david-binda 382e66f
Addressing styling issues flagged by PHPCS
david-binda 2a912a5
One more PHPCS coding standard violation fix. I must have missed that…
david-binda dd1b6f0
Using just a single `*` for multiline comments which are not a docblock
david-binda 0698ae1
Fixing typos s/open_short_tag/short_open_tag/ and s/open short tags/s…
david-binda a361850
Adding @since mark for newly introduced private property `short_open_…
david-binda b52d30c
Updating regex for catching missed escaping the way it catches also a…
david-binda fde244e
Fixing typo `it''s` => `it's`
david-binda c8e48ec
Fix wrong copy pasting of updated regex
david-binda 60d3bf1
Fixing typo in comment /s/outputing/outputting/
david-binda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,7 @@ public function register() { | |
T_PRINT, | ||
T_EXIT, | ||
T_STRING, | ||
T_OPEN_TAG_WITH_ECHO, | ||
); | ||
|
||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,3 +205,13 @@ to_screen( esc_form_field( $var1), esc_attr( $var2 ) ); // Ok. | |
echo esc_form_field( $var ); // Bad. | ||
echo post_info( $post_id, 'field' ); // Bad. | ||
echo cpt_info( $post_type, 'query' ); // Bad. | ||
|
||
// Bad. | ||
?> | ||
<?= $var ?> | ||
<?php | ||
|
||
// Ok. | ||
<?= esc_html( $var ); ?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. The immediately-preceding |
||
<?php | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ public function getErrorList() { | |
205 => 1, | ||
206 => 1, | ||
207 => 1, | ||
211 => 1, | ||
); | ||
|
||
} // end getErrorList() | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a PHP closing tag is missing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing the build failure: you could just change the comment to an HTML comment instead ?