[wp-trac] [WordPress Trac] #25170: Add actual file size to attachment publish meta box

WordPress Trac noreply at wordpress.org
Tue Sep 24 19:37:42 UTC 2013


#25170: Add actual file size to attachment publish meta box
-------------------------+-----------------------
 Reporter:  desrosj      |       Owner:  helen
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.7
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+-----------------------
Changes (by DrewAPicture):

 * keywords:  has-patch commit => has-patch
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Looks like `filesize()` tosses a warning in this context if the file
 doesn't actually exist in a media item that does exist.

 {{{
 Warning: filesize(): stat failed for /srv/www/mutrunk/src/wp-
 content/uploads/2013/07/image.jpg in /srv/www/mutrunk/src/wp-
 admin/includes/media.php on line 2457
 }}}

 We could either
 1) Silence the errors on `filesize()` with an `@`, though this really just
 hides the larger problem
 2) Add a `file_exists()` check in `get_attached_file()` to return false if
 the file doesn't exist.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25170#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list