Opened 9 years ago
Closed 9 years ago
#36635 closed defect (bug) (fixed)
Issue with size_format function when value is 0
Reported by: | bangelov | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 2.3 |
Component: | General | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description (last modified by )
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).
Attachments (3)
Change History (11)
#3
@
9 years ago
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
- Milestone changed from Awaiting Review to 4.6
#4
@
9 years ago
There are some size_format()
tests in tests/functions.php
, might be worth combining them.
Also related: #23626.
#5
@
9 years ago
Thanks @SergeyBiryukov, totally missed those!
36635.2.diff combines the tests.
Note: See
TracTickets for help on using
tickets.
Seems legit to me. Will whip up a patch shortly.