Skip to content

Commit

Permalink
Merge pull request #35335 from nextcloud/stable25-revert-34032-fix-qu…
Browse files Browse the repository at this point in the history
…ota-32bit

Revert "[stable25] Fix quota type to int"
  • Loading branch information
blizzz authored Nov 24, 2022
2 parents c1857ef + 7bcd419 commit 4c99ba4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/private/legacy/OC_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function humanFileSize($bytes) {
/**
* Make a computer file size
* @param string $str file size in human readable format
* @return int|false a file size in bytes
* @return float|false a file size in bytes
*
* Makes 2kB to 2048.
*
Expand All @@ -104,7 +104,7 @@ public static function humanFileSize($bytes) {
public static function computerFileSize($str) {
$str = strtolower($str);
if (is_numeric($str)) {
return (int)$str;
return (float)$str;
}

$bytes_array = [
Expand All @@ -131,7 +131,7 @@ public static function computerFileSize($str) {

$bytes = round($bytes);

return (int)$bytes;
return $bytes;
}

/**
Expand Down Expand Up @@ -577,7 +577,7 @@ public static function getStorageInfo($path, $rootInfo = null, $includeMountPoin
/**
* Get storage info including all mount points and quota
*/
private static function getGlobalStorageInfo(int $quota, IUser $user, IMountPoint $mount): array {
private static function getGlobalStorageInfo(float $quota, IUser $user, IMountPoint $mount): array {
$rootInfo = \OC\Files\Filesystem::getFileInfo('', 'ext');
$used = $rootInfo['size'];
if ($used < 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static function isDefaultExpireDateEnforced() {
* Get the quota of a user
*
* @param IUser|null $user
* @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false Quota bytes
* @return float|\OCP\Files\FileInfo::SPACE_UNLIMITED|false Quota bytes
*/
public static function getUserQuota(?IUser $user) {
if (is_null($user)) {
Expand Down

0 comments on commit 4c99ba4

Please sign in to comment.