Code Review - Escaping, reference operators, url protocols#107
Closed
christianc1 wants to merge 8 commits into
Closed
Code Review - Escaping, reference operators, url protocols#107christianc1 wants to merge 8 commits into
christianc1 wants to merge 8 commits into
Conversation
joshbetz
reviewed
May 18, 2017
| } | ||
|
|
||
| echo PHP_EOL; | ||
| echo esc_html( PHP_EOL ); |
Contributor
There was a problem hiding this comment.
Constants and string literals don't need to be escaped.
Contributor
Author
|
@joshbetz : Following up on this, anything additional I can do to help this along? |
Closed
GaryJones
reviewed
Mar 15, 2022
Collaborator
GaryJones
left a comment
There was a problem hiding this comment.
I've cherry-picked some of these commits into a new branch, and fixed up the issues I've highlighted.
| $output = '<div id="inline_' . $item['post_id'] . '" style="display:none;">'; | ||
| $output .= '<div class="id">' . $item['post_id'] . '</div>'; | ||
| $output = '<div id="inline_' . esc_attr( $item['post_id'] ) . '" style="display:none;">'; | ||
| $output .= '<div class="id">' . esc_attr( $item['post_id'] ) . '</div>'; |
Collaborator
There was a problem hiding this comment.
This should be esc_html().
| public function __construct() { | ||
| // Default output HTML | ||
| $this->output_html ='<div id="acm-ad-tag-%tag%"><script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | ||
| $this->output_html ='<div id="acm-ad-tag-%tag%"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |
Collaborator
There was a problem hiding this comment.
Protocol-less URLs are an anti-pattern.
| //--> | ||
| </script> | ||
| <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>'; | ||
| <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>'; |
Collaborator
There was a problem hiding this comment.
Protocol-less URLs are an anti-pattern.
| <div class="form-field form-required"> | ||
| <label for="<?php echo esc_attr( $column_id ) ?>"><?php echo esc_html( $arg['label'] ) ?></label> | ||
| <input name="<?php echo esc_attr( $column_id ) ?>" id="<?php echo esc_attr( $column_id ) ?>" type="text" value="" size="40" aria-required="<?php echo $arg['required'] ?>"> | ||
| <input name="<?php echo esc_attr( $column_id ) ?>" id="<?php echo esc_attr( $column_id ) ?>" type="text" value="" size="40" aria-required="<?php echo esc_url( $arg['required'] ); ?>"> |
Collaborator
There was a problem hiding this comment.
This should be esc_attr().
Collaborator
|
Closing this PR, as the new branch will contain some of the work done in this PR. Thank you for your contribution! |
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.
Original review was done for @campusinsiders on @wpcomvip by @tomjn.
Figuring the changeset is valuable for others as well, I added some additional missed escaping and put it all together as a pull request.
.org users:
tjnowell (Tom)
christian1012 (me)