diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-01-23 10:05:20 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2023-02-07 11:23:29 +0100 |
commit | 255f230a875d947b81487f9316c03bac606e7ce0 (patch) | |
tree | 1cde3ae5acd1db931557d81c3a6aa88f2403d98f /lib/private/legacy | |
parent | 5cfab229db04684a8fb5ff0cd7253227dddf6b61 (diff) | |
download | nextcloud-server-255f230a875d947b81487f9316c03bac606e7ce0.tar.gz nextcloud-server-255f230a875d947b81487f9316c03bac606e7ce0.zip |
Fix bigsize support on 32bits in OC_Helper
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_Helper.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index 9ecd05b0a73..7d0837402fa 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -95,17 +95,14 @@ class OC_Helper { /** * Make a computer file size * @param string $str file size in human readable format - * @return int|false a file size in bytes + * @return false|int|float a file size in bytes * * Makes 2kB to 2048. * * Inspired by: https://www.php.net/manual/en/function.filesize.php#92418 */ - public static function computerFileSize($str) { + public static function computerFileSize(string $str): false|int|float { $str = strtolower($str); - if (is_numeric($str)) { - return (int)$str; - } $bytes_array = [ 'b' => 1, @@ -131,14 +128,14 @@ class OC_Helper { $bytes = round($bytes); - return (int)$bytes; + return $bytes; } /** * Recursive copying of folders * @param string $src source folder * @param string $dest target folder - * + * @return void */ public static function copyr($src, $dest) { if (is_dir($src)) { |