aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 8954f9921..480152400 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -231,8 +231,8 @@ function format_bytes(int $bytes, int $precision = 2, string $system = 'IEC'): s
return format_number($bytes, $precision);
}
$bytes = max(intval($bytes), 0);
- $pow = $bytes === 0 ? 0 : floor(log($bytes) / log($base));
- $pow = min($pow, count($units) - 1);
+ $pow = $bytes === 0 ? 0 : (int)floor(log($bytes) / log($base));
+ $pow = min(max(0, $pow), count($units) - 1);
$bytes /= pow($base, $pow);
return format_number($bytes, $precision) . ' ' . $units[$pow];
}