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:
parent
7f396bfab0
commit
44abe2e502
|
@ -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 );
|
||||||
|
|
|
@ -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 ),
|
||||||
|
|
Loading…
Reference in New Issue