Skip to content

Commit

Permalink
Coding Standards: Use esc_url() instead of esc_attr() for some URLs.
Browse files Browse the repository at this point in the history
Follow-up to [2063], [2182], [4656], [6952], [9098], [11109], [11204], [17887], [22505], 

Props kebbet.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52957


git-svn-id: http://core.svn.wordpress.org/trunk@52546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
SergeyBiryukov committed Mar 19, 2022
1 parent 280aabe commit 8cdec43
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
20 changes: 9 additions & 11 deletions wp-admin/includes/class-custom-image-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,21 +651,19 @@ public function step_1() {
<?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
</p>
<?php
$modal_update_href = esc_url(
add_query_arg(
array(
'page' => 'custom-header',
'step' => 2,
'_wpnonce-custom-header-upload' => wp_create_nonce( 'custom-header-upload' ),
),
admin_url( 'themes.php' )
)
);
$modal_update_href = add_query_arg(
array(
'page' => 'custom-header',
'step' => 2,
'_wpnonce-custom-header-upload' => wp_create_nonce( 'custom-header-upload' ),
),
admin_url( 'themes.php' )
);
?>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
<button id="choose-from-library-link" class="button"
data-update-link="<?php echo esc_attr( $modal_update_href ); ?>"
data-update-link="<?php echo esc_url( $modal_update_href ); ?>"
data-choose="<?php esc_attr_e( 'Choose a Custom Header' ); ?>"
data-update="<?php esc_attr_e( 'Set as header' ); ?>"><?php _e( 'Choose Image' ); ?></button>
</p>
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/class-wp-comments-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ public function column_comment( $comment ) {
<textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( $comment_content ); ?></textarea>
<div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
<div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
<div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
<div class="author-url"><?php echo esc_url( $comment->comment_author_url ); ?></div>
<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
</div>
<?php
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ function wp_dashboard_browser_nag() {
if ( ! empty( $response['img_src'] ) ) {
$img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) ) ? $response['img_src_ssl'] : $response['img_src'];

$notice .= '<div class="alignright browser-icon"><img src="' . esc_attr( $img_src ) . '" alt="" /></div>';
$notice .= '<div class="alignright browser-icon"><img src="' . esc_url( $img_src ) . '" alt="" /></div>';
$browser_nag_class = ' has-browser-icon';
}
$notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function get_image_tag( $id, $alt, $title, $align, $size = 'medium' ) {
*/
$class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );

$html = '<img src="' . esc_attr( $img_src ) . '" alt="' . esc_attr( $alt ) . '" ' . $title . $hwstring . 'class="' . $class . '" />';
$html = '<img src="' . esc_url( $img_src ) . '" alt="' . esc_attr( $alt ) . '" ' . $title . $hwstring . 'class="' . $class . '" />';

/**
* Filters the HTML content for the image tag.
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-alpha-52956';
$wp_version = '6.0-alpha-52957';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down
2 changes: 1 addition & 1 deletion wp-links-opml.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
*/
$title = apply_filters( 'link_title', $bookmark->link_name );
?>
<outline text="<?php echo esc_attr( $title ); ?>" type="link" xmlUrl="<?php echo esc_attr( $bookmark->link_rss ); ?>" htmlUrl="<?php echo esc_attr( $bookmark->link_url ); ?>" updated="
<outline text="<?php echo esc_attr( $title ); ?>" type="link" xmlUrl="<?php echo esc_url( $bookmark->link_rss ); ?>" htmlUrl="<?php echo esc_url( $bookmark->link_url ); ?>" updated="
<?php
if ( '0000-00-00 00:00:00' !== $bookmark->link_updated ) {
echo $bookmark->link_updated;}
Expand Down

0 comments on commit 8cdec43

Please sign in to comment.