Make WordPress Core

Changeset 25608


Ignore:
Timestamp:
09/24/2013 08:22:24 PM (11 years ago)
Author:
helen
Message:

Make sure the attachment file exists before calling filesize() on it. props DrewAPicture. fixes #25170.

File:
1 edited

Legend:

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

    r25403 r25608  
    24522452
    24532453    <?php
     2454        $file  = get_attached_file( $post->ID );
     2455        $file_size = false;
     2456
    24542457        if ( isset( $meta['filesize'] ) )
    24552458            $file_size = $meta['filesize'];
    2456         else
    2457             $file_size = filesize( get_attached_file( $post->ID ) );
     2459        elseif ( file_exists( $file ) )
     2460            $file_size = filesize( $file );
    24582461
    24592462        if ( ! empty( $file_size ) ) : ?>
Note: See TracChangeset for help on using the changeset viewer.