[wp-trac] [WordPress Trac] #36635: Issue with size_format function when value is 0

WordPress Trac noreply at wordpress.org
Fri Apr 22 17:08:07 UTC 2016


#36635: Issue with size_format function when value is 0
--------------------------+------------------------------
 Reporter:  bangelov      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Description changed by swissspidy:

Old description:

> When you invoke size_format(0) function with zero value it should return
> '''0 B''' instead it returns '''false''' which is wrong. For example when
> you are looping files and some of them is zero byte file it will return
> false and will brake the UI if function is directly used in the view
> (most cases).

New description:

 When you invoke `size_format(0)` function with zero value it should return
 `0 B` instead it returns `false` which is wrong. For example when you are
 looping files and some of them is zero byte file it will return `false`
 and will break the UI if function is directly used in the view (most
 cases).

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36635#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list