diff options
| author | 2025-08-07 22:19:45 +0200 | |
|---|---|---|
| committer | 2025-08-07 22:19:45 +0200 | |
| commit | 62f32ccadff77594f5b8e3ad24c4c2541ff35885 (patch) | |
| tree | 29689e66fd16fcbeb385cda554890d45d66e58c2 /lib/lib_rss.php | |
| parent | 149136fbe252cca4cb8dcdb463df135094bc0f87 (diff) | |
PHPStan: finalise strictArrayFilter (#7794)
As well as reportPossiblyNonexistentConstantArrayOffset.
And disable PHPStan-next from GitHub Action, since the work is completed for now.
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 4 |
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]; } |
