Make WordPress Core

Ticket #24716: 24716.3.patch

File 24716.3.patch, 609 bytes (added by SergeyBiryukov, 11 years ago)
  • src/wp-includes/media.php

     
    26012601                $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(No title)' );
    26022602        }
    26032603
    2604         $bytes = filesize( get_attached_file( $attachment->ID ) );
     2604        $file = get_attached_file( $attachment->ID );
     2605        $bytes = ( file_exists( $file ) ) ? filesize( $file ) : 0;
    26052606        $response['filesizeInBytes'] = $bytes;
    26062607        $response['filesizeHumanReadable'] = size_format( $bytes );
    26072608