Use wp_basename() in newer media code for filenames to avoid encoding issues on display. props SergeyBiryukov, fixes #23267.

git-svn-id: http://core.svn.wordpress.org/trunk@24585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-08 13:55:50 +00:00
parent 7f396bfab0
commit 44abe2e502
2 changed files with 2 additions and 2 deletions

View File

@ -2423,7 +2423,7 @@ function edit_form_image_editor( $post ) {
function attachment_submitbox_metadata() {
$post = get_post();
$filename = esc_html( basename( $post->guid ) );
$filename = esc_html( wp_basename( $post->guid ) );
$media_dims = '';
$meta = wp_get_attachment_metadata( $post->ID );

View File

@ -1606,7 +1606,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
$response = array(
'id' => $attachment->ID,
'title' => $attachment->post_title,
'filename' => basename( $attachment->guid ),
'filename' => wp_basename( $attachment->guid ),
'url' => $attachment_url,
'link' => get_attachment_link( $attachment->ID ),
'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),