From 3b278ac0da30e4c781e336172fcced57b4efb2cf Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 13 May 2022 14:26:58 +0200 Subject: [eventlog] Cast numeric values to int explicitly, in case they are '' --- inc/util.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/util.inc.php') diff --git a/inc/util.inc.php b/inc/util.inc.php index d95265f4..b4340c94 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -113,7 +113,7 @@ class Util $decimals = 2 - floor(strlen((int)$bytes) - 1); } } - return sprintf("%.{$decimals}f", $bytes) . "\xe2\x80\x89" . $sz[$factor + $shift]; + return sprintf("%.{$decimals}f", $bytes) . "\xe2\x80\x89" . ($sz[$factor + $shift] ?? '#>PiB#'); } public static function sanitizeFilename(string $name) -- cgit v1.2.3-55-g7522