Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quota type to int #34019

Merged
merged 1 commit into from Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/private/legacy/OC_Helper.php
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 float|false a file size in bytes
* @return int|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 (float)$str;
return (int)$str;
}

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

$bytes = round($bytes);

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

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/legacy/OC_Util.php
Expand Up @@ -158,7 +158,7 @@ public static function isDefaultExpireDateEnforced() {
* 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)) {
Expand Down