summaryrefslogtreecommitdiffstats
path: root/inc/util.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-13 14:26:58 +0200
committerSimon Rettberg2022-05-13 14:26:58 +0200
commit3b278ac0da30e4c781e336172fcced57b4efb2cf (patch)
tree212938732f40bcb25dbe4d147a15b86ebec09777 /inc/util.inc.php
parent[statistics] Fix undefined index notices (diff)
downloadslx-admin-3b278ac0da30e4c781e336172fcced57b4efb2cf.tar.gz
slx-admin-3b278ac0da30e4c781e336172fcced57b4efb2cf.tar.xz
slx-admin-3b278ac0da30e4c781e336172fcced57b4efb2cf.zip
[eventlog] Cast numeric values to int explicitly, in case they are ''
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r--inc/util.inc.php2
1 files changed, 1 insertions, 1 deletions
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)