Media: Use correct escaping function for URLs in some legacy media functions.

This affects:
* `get_image_send_to_editor()`
* `image_link_input_fields()`

Follow-up to [7092], [7874], [8653], [11109], [11204], [11383], [12051], [12199], [19982].

Props smit08, mukesh27.
Fixes #56064.
Built from https://develop.svn.wordpress.org/trunk@53570


git-svn-id: http://core.svn.wordpress.org/trunk@53159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-06-24 13:52:13 +00:00
parent bb92e303d7
commit 7abd4bc951
2 changed files with 4 additions and 4 deletions

View File

@ -145,7 +145,7 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re
}
if ( $url ) {
$html = '<a href="' . esc_attr( $url ) . '"' . $rel . '>' . $html . '</a>';
$html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
}
/**
@ -1269,8 +1269,8 @@ function image_link_input_fields( $post, $url_type = '' ) {
return "
<input type='text' class='text urlfield' name='attachments[$post->ID][url]' value='" . esc_attr( $url ) . "' /><br />
<button type='button' class='button urlnone' data-link-url=''>" . __( 'None' ) . "</button>
<button type='button' class='button urlfile' data-link-url='" . esc_attr( $file ) . "'>" . __( 'File URL' ) . "</button>
<button type='button' class='button urlpost' data-link-url='" . esc_attr( $link ) . "'>" . __( 'Attachment Post URL' ) . '</button>
<button type='button' class='button urlfile' data-link-url='" . esc_url( $file ) . "'>" . __( 'File URL' ) . "</button>
<button type='button' class='button urlpost' data-link-url='" . esc_url( $link ) . "'>" . __( 'Attachment Post URL' ) . '</button>
';
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53568';
$wp_version = '6.1-alpha-53570';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.