mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Fix setQuota on User on 32bits
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
d00422b812
commit
5aed587e25
1 changed files with 6 additions and 2 deletions
|
|
@ -513,13 +513,17 @@ class User implements IUser {
|
|||
*
|
||||
* @param string $quota
|
||||
* @return void
|
||||
* @throws InvalidArgumentException
|
||||
* @since 9.0.0
|
||||
*/
|
||||
public function setQuota($quota) {
|
||||
$oldQuota = $this->config->getUserValue($this->uid, 'files', 'quota', '');
|
||||
if ($quota !== 'none' and $quota !== 'default') {
|
||||
$quota = OC_Helper::computerFileSize($quota);
|
||||
$quota = OC_Helper::humanFileSize((int)$quota);
|
||||
$bytesQuota = OC_Helper::computerFileSize($quota);
|
||||
if ($bytesQuota === false) {
|
||||
throw new InvalidArgumentException('Failed to set quota to invalid value '.$quota);
|
||||
}
|
||||
$quota = OC_Helper::humanFileSize($bytesQuota);
|
||||
}
|
||||
if ($quota !== $oldQuota) {
|
||||
$this->config->setUserValue($this->uid, 'files', 'quota', $quota);
|
||||
|
|
|
|||
Loading…
Reference in a new issue