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:
parent
648af753fd
commit
ab117ae99c
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user