summaryrefslogtreecommitdiff
path: root/app/Helper/TextHelper.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-02-04 18:25:41 -0500
committerFrederic Guillot <fred@kanboard.net>2017-02-04 18:25:41 -0500
commit630707050755f414ce91faf880fd407a6fe63174 (patch)
tree03318b8ce79c2229e42302b86d2044b01bc09fb2 /app/Helper/TextHelper.php
parentfe3ac50aca23ed015b7fb523947b468361afa5c8 (diff)
Do not try to format size if 0
Diffstat (limited to 'app/Helper/TextHelper.php')
-rw-r--r--app/Helper/TextHelper.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/Helper/TextHelper.php b/app/Helper/TextHelper.php
index 654eb171..66583cd1 100644
--- a/app/Helper/TextHelper.php
+++ b/app/Helper/TextHelper.php
@@ -59,6 +59,10 @@ class TextHelper extends Base
*/
public function bytes($size, $precision = 2)
{
+ if ($size == 0) {
+ return 0;
+ }
+
$base = log($size) / log(1024);
$suffixes = array('', 'k', 'M', 'G', 'T');