Admin: Escape attachment name in case it contains special characters

Built from https://develop.svn.wordpress.org/trunk@37774


git-svn-id: http://core.svn.wordpress.org/trunk@37739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Nikolay Bachiyski 2016-06-21 14:20:55 +00:00
parent 2bdc11781d
commit 4372cdf45d
3 changed files with 3 additions and 3 deletions

View File

@ -395,7 +395,7 @@ class WP_Media_List_Table extends WP_List_Table {
<span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span> <span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span>
<?php <?php
$file = get_attached_file( $post->ID ); $file = get_attached_file( $post->ID );
echo wp_basename( $file ); echo esc_html( wp_basename( $file ) );
?> ?>
</p> </p>
<?php <?php

View File

@ -1475,7 +1475,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
* @param bool $icon Whether to include an icon. Default false. * @param bool $icon Whether to include an icon. Default false.
* @param string|bool $text If string, will be link text. Default false. * @param string|bool $text If string, will be link text. Default false.
*/ */
return apply_filters( 'wp_get_attachment_link', "<a href='$url'>$link_text</a>", $id, $size, $permalink, $icon, $text ); return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text );
} }
/** /**

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-alpha-37756'; $wp_version = '4.6-alpha-37774';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.