Make WordPress Core

Changeset 32914


Ignore:
Timestamp:
06/23/2015 06:29:44 PM (11 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r32866 r32914  
    27212721                'id'          => $attachment->ID,
    27222722                'title'       => $attachment->post_title,
    2723                 'filename'    => wp_basename( $attachment->guid ),
     2723                'filename'    => wp_basename( get_attached_file( $attachment->ID ) ),
    27242724                'url'         => $attachment_url,
    27252725                'link'        => get_attachment_link( $attachment->ID ),
Note: See TracChangeset for help on using the changeset viewer.