diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-07 17:56:13 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-07 17:56:13 +0200 |
commit | 15d134124bde5fa8693c640a3db000a9bc47d51f (patch) | |
tree | 6350883bd7de85ac4b9e07e3b5124bd6ee2a5890 /apps/provisioning_api/lib | |
parent | 9f2f2821919ed770fd4ede17f27a22d6c17dc374 (diff) | |
download | nextcloud-server-15d134124bde5fa8693c640a3db000a9bc47d51f.tar.gz nextcloud-server-15d134124bde5fa8693c640a3db000a9bc47d51f.zip |
Validate the quota value to be a correct value
Diffstat (limited to 'apps/provisioning_api/lib')
-rw-r--r-- | apps/provisioning_api/lib/users.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/provisioning_api/lib/users.php b/apps/provisioning_api/lib/users.php index 505a141c032..43cf22b071b 100644 --- a/apps/provisioning_api/lib/users.php +++ b/apps/provisioning_api/lib/users.php @@ -155,7 +155,14 @@ class Users { case 'quota': $quota = $parameters['_put']['value']; if($quota !== 'none' and $quota !== 'default') { - $quota = OC_Helper::computerFileSize($quota); + if (is_numeric($quota)) { + $quota = floatval($quota); + } else { + $quota = OC_Helper::computerFileSize($quota); + } + if ($quota === false) { + return new OC_OCS_Result(null, 103, "Invalid quota value {$parameters['_put']['value']}"); + } if($quota == 0) { $quota = 'default'; }else if($quota == -1){ |