From c1953123fe0775152f78484f9449d8b54dc047cd Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 12 Sep 2022 09:26:04 +0200 Subject: Fix quota type to int Change the quota to int from float, since the quota is a number of bits and a bits can not be splitted. Fix #34010 Signed-off-by: Carl Schwan --- lib/private/legacy/OC_Helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 6aa0b582c21..0dda07c0303 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -104,7 +104,7 @@ class OC_Helper { public static function computerFileSize($str) { $str = strtolower($str); if (is_numeric($str)) { - return (float)$str; + return (int)$str; } $bytes_array = [ @@ -131,7 +131,7 @@ class OC_Helper { $bytes = round($bytes); - return $bytes; + return (int)$bytes; } /** -- cgit v1.2.3 From cb8be0c6321c1dc21d0fc27ab4a7e0313625aab7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 12 Sep 2022 09:26:04 +0200 Subject: Fix quota type to int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the quota to int from float, since the quota is a number of bits and a bits can not be splitted. Fix #34010 Signed-off-by: Carl Schwan Signed-off-by: Côme Chilliet --- lib/private/legacy/OC_Helper.php | 2 +- lib/private/legacy/OC_Util.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 0dda07c0303..733085c0f3a 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -95,7 +95,7 @@ class OC_Helper { /** * Make a computer file size * @param string $str file size in human readable format - * @return float|bool a file size in bytes + * @return int|false a file size in bytes * * Makes 2kB to 2048. * diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index edee23995f1..959e8c02609 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -158,7 +158,7 @@ class OC_Util { * Get the quota of a user * * @param IUser|null $user - * @return float Quota bytes + * @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false Quota bytes */ public static function getUserQuota(?IUser $user) { if (is_null($user)) { -- cgit v1.2.3