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

WordPress Trac noreply at wordpress.org
Tue Sep 24 19:40:19 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    |
-------------------------+-----------------------

Comment (by nacin):

 Replying to [comment:14 DrewAPicture]:
 > Looks like `filesize()` tosses a warning in this context if the file
 doesn't actually exist in a media item that does exist.

 When does this occur?

 And, yes, a file_exists() would be fine. I *don't* think it makes sense
 inside get_attached_file(), though, for replication reasons.
 get_attached_file() returns the path to where the file should be, but I'm
 not sure that's a "promise".

 Either way, we need to make sure get_attached_file() returns a valid value
 before calling filesize() on it.

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


More information about the wp-trac mailing list