In `wp_prepare_attachment_for_js()`, when setting `filename`, call `wp_basename()` on the result of `get_attached_file()`, not `WP_Post->guid`. `guid` can be set to the result `get_permalink()`, which is not a file path.

Props daxelrod.
Fixes #32531.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-06-23 18:30:26 +00:00
parent f61501f57f
commit 3b88c839f9
2 changed files with 2 additions and 2 deletions

View File

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

View File

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