aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Helper.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-01-23 12:13:32 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-02-07 11:23:30 +0100
commitd00422b812d27df56ca9e07159fc14073357f0c4 (patch)
tree2a21f9cb6e6ea432b67551d8df7416bacc1a5540 /lib/private/legacy/OC_Helper.php
parent0753be3ff29b459bdbb23deecc37c3e4c05d8464 (diff)
downloadnextcloud-server-d00422b812d27df56ca9e07159fc14073357f0c4.tar.gz
nextcloud-server-d00422b812d27df56ca9e07159fc14073357f0c4.zip
Fix computerFileSize when called with a string without unit
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/legacy/OC_Helper.php')
-rw-r--r--lib/private/legacy/OC_Helper.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 5301fe5a498..61f87cdbed5 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -104,6 +104,9 @@ class OC_Helper {
*/
public static function computerFileSize(string $str): false|int|float {
$str = strtolower($str);
+ if (is_numeric($str)) {
+ return Util::numericToNumber($str);
+ }
$bytes_array = [
'b' => 1,