Skip to content

Commit

Permalink
Admin: Escape attachment name in case it contains special characters
Browse files Browse the repository at this point in the history
Built from https://develop.svn.wordpress.org/trunk@37774


git-svn-id: http://core.svn.wordpress.org/trunk@37739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nb committed Jun 21, 2016
1 parent 2bdc117 commit 4372cdf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wp-admin/includes/class-wp-media-list-table.php
Expand Up @@ -395,7 +395,7 @@ public function column_title( $post ) {
<span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span>
<?php
$file = get_attached_file( $post->ID );
echo wp_basename( $file );
echo esc_html( wp_basename( $file ) );
?>
</p>
<?php
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/post-template.php
Expand Up @@ -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 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 );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -4,7 +4,7 @@
*
* @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.
Expand Down

0 comments on commit 4372cdf

Please sign in to comment.