mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
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 <carl@carlschwan.eu>
This commit is contained in:
parent
71d0ea84c3
commit
d61efdff6c
2 changed files with 4 additions and 4 deletions
|
|
@ -95,7 +95,7 @@ class OC_Helper {
|
|||
/**
|
||||
* Make a computer file size
|
||||
* @param string $str file size in human readable format
|
||||
* @return float|false a file size in bytes
|
||||
* @return int|false a file size in bytes
|
||||
*
|
||||
* Makes 2kB to 2048.
|
||||
*
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class OC_Util {
|
|||
* Get the quota of a user
|
||||
*
|
||||
* @param IUser|null $user
|
||||
* @return float|\OCP\Files\FileInfo::SPACE_UNLIMITED|false Quota bytes
|
||||
* @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false Quota bytes
|
||||
*/
|
||||
public static function getUserQuota(?IUser $user) {
|
||||
if (is_null($user)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue