Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-24 10:20:13 +0300
committerVincent Petry <pvince81@owncloud.com>2016-06-24 10:20:13 +0300
commit819b7c45a94dd86e673a478d13ae100e9bc34ad4 (patch)
treefedb49a8ee65b9c373e2625aca6ecc8459831f94 /settings
parent6c1ea7a54b01595c1f760ba15b47fb368ca11c6f (diff)
Prevent negative or non-number values in quota input
Diffstat (limited to 'settings')
-rw-r--r--settings/js/users/users.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index a4d88204861..2524a1da0bb 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -582,6 +582,12 @@ var UserList = {
if (quota === 'other') {
return;
}
+ if (isNaN(parseInt(quota, 10)) || parseInt(quota, 10) < 0) {
+ // the select component has added the bogus value, delete it again
+ $select.find('option[selected]').remove();
+ OC.Notification.showTemporary(t('core', 'Invalid quota value "{val}"', {val: quota}));
+ return;
+ }
UserList._updateQuota(uid, quota, function(returnedQuota){
if (quota !== returnedQuota) {
$select.find(':selected').text(returnedQuota);