Make WordPress Core

Ticket #33214: 33214.diff

File 33214.diff, 727 bytes (added by polevaultweb, 9 years ago)
  • src/wp-includes/media.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    27622762        }
    27632763
    27642764        $attached_file = get_attached_file( $attachment->ID );
    2765         if ( file_exists( $attached_file ) ) {
     2765
     2766        $bytes = false;
     2767        if ( isset( $meta['filesize'] ) ) {
     2768                $bytes = $meta['filesize'];
     2769        } else if ( file_exists( $attached_file ) ) {
    27662770                $bytes = filesize( $attached_file );
     2771        }
     2772
     2773        if ( ! empty( $bytes ) ) {
    27672774                $response['filesizeInBytes'] = $bytes;
    27682775                $response['filesizeHumanReadable'] = size_format( $bytes );
    27692776        }