diff options
-rw-r--r-- | core/Command/Log/File.php | 4 | ||||
-rw-r--r-- | lib/private/legacy/OC_Helper.php | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/Command/Log/File.php b/core/Command/Log/File.php index f2c77e20174..6d6e530fe9a 100644 --- a/core/Command/Log/File.php +++ b/core/Command/Log/File.php @@ -115,14 +115,12 @@ class File extends Command implements Completion\CompletionAwareInterface { } /** - * @param mixed $rotateSize * @throws \InvalidArgumentException */ - protected function validateRotateSize(&$rotateSize) { + protected function validateRotateSize(false|int|float $rotateSize): void { if ($rotateSize === false) { throw new \InvalidArgumentException('Error parsing log rotation file size'); } - $rotateSize = (int) $rotateSize; if ($rotateSize < 0) { throw new \InvalidArgumentException('Log rotation file size must be non-negative'); } 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, |