mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Make sure the attachment file exists before calling filesize() on it. props DrewAPicture. fixes #25170.
Built from https://develop.svn.wordpress.org/trunk@25608 git-svn-id: http://core.svn.wordpress.org/trunk@25525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9dcd0110fb
commit
9d5c2eb55f
@ -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