From: Vincent Vanwaelscappel Date: Wed, 15 Feb 2023 18:38:01 +0000 (+0100) Subject: wip #5718 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7ae5d8e1e37dd5f2c1399829de3f13979a2adcc2;p=cubist_util.git wip #5718 @0:10 --- diff --git a/src/Files/Files.php b/src/Files/Files.php index a011080..192ea84 100644 --- a/src/Files/Files.php +++ b/src/Files/Files.php @@ -55,6 +55,10 @@ class Files public static function humanReadableSize($size, $precision = 2) { + if ($size == 0) { + return 0; + } + $base = log($size) / log(1024); $suffixes = array('', 'k', 'M', 'G', 'T');