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

git-svn-id: https://develop.svn.wordpress.org/trunk@24585 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-07-08 13:55:50 +00:00
parent bcf8ba4d44
commit cdaa82bc9b
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() { function attachment_submitbox_metadata() {
$post = get_post(); $post = get_post();
$filename = esc_html( basename( $post->guid ) ); $filename = esc_html( wp_basename( $post->guid ) );
$media_dims = ''; $media_dims = '';
$meta = wp_get_attachment_metadata( $post->ID ); $meta = wp_get_attachment_metadata( $post->ID );

View File

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