diff --git a/wp-includes/media.php b/wp-includes/media.php index 4dfefd4398..c4c8961b9f 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2778,8 +2778,16 @@ function wp_prepare_attachment_for_js( $attachment ) { } $attached_file = get_attached_file( $attachment->ID ); - if ( file_exists( $attached_file ) ) { + + if ( isset( $meta['filesize'] ) ) { + $bytes = $meta['filesize']; + } elseif ( file_exists( $attached_file ) ) { $bytes = filesize( $attached_file ); + } else { + $bytes = ''; + } + + if ( $bytes ) { $response['filesizeInBytes'] = $bytes; $response['filesizeHumanReadable'] = size_format( $bytes ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index c820deef89..9a8029bb00 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34257'; +$wp_version = '4.4-alpha-34258'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.