diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 5988cc89b..e1ec4ae50 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -220,6 +220,11 @@ class Strings */ public static function formatBytes(int $bytes, int $precision = 2): string { + // If this method is called for an infinite (== unlimited) amount of bytes: + if ($bytes == INF) { + return INF; + } + $units = ['B', 'KB', 'MB', 'GB', 'TB']; $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024));