Make WordPress Core


Ignore:
Timestamp:
09/15/2015 02:49:12 AM (11 years ago)
Author:
wonderboymusic
Message:

Don't ever use the guid value when retrieving URLs for media, use wp_get_attachment_url(). Use get_attached_file() for path to file.

Fixes #33386.

File:
1 edited

Legend:

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

    r34158 r34163  
    46494649                wp_delete_comment( $comment_id, true );
    46504650        }
    4651        
     4651
    46524652        wp_defer_comment_counting( false );
    46534653
     
    49754975                        if ( $post = get_post( $mime ) ) {
    49764976                                $post_id = (int) $post->ID;
    4977                                 $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid);
     4977                                $file = get_attached_file( $post_id );
     4978                                $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $file);
    49784979                                if ( !empty($ext) ) {
    49794980                                        $post_mimes[] = $ext;
Note: See TracChangeset for help on using the changeset viewer.