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

git-svn-id: https://develop.svn.wordpress.org/trunk@25608 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2013-09-24 20:22:24 +00:00
parent 648af753fd
commit ab117ae99c

View File

@ -2451,10 +2451,13 @@ function attachment_submitbox_metadata() {
</div>
<?php
$file = get_attached_file( $post->ID );
$file_size = false;
if ( isset( $meta['filesize'] ) )
$file_size = $meta['filesize'];
else
$file_size = filesize( get_attached_file( $post->ID ) );
elseif ( file_exists( $file ) )
$file_size = filesize( $file );
if ( ! empty( $file_size ) ) : ?>
<div class="misc-pub-section misc-pub-filesize">