From f1fccaca0605a5d183f78b2c39d2e09a54753787 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Mon, 27 Feb 2017 12:34:15 +0545 Subject: better quota validation this fixes #3634 1. fixed computerFileSize to be more picky about incorrect values 2. more tests for computerFileSize 3. use computerFileSize to validate user quota Signed-off-by: Artur Neumann --- settings/js/users/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'settings/js/users/users.js') diff --git a/settings/js/users/users.js b/settings/js/users/users.js index a2ccc059f15..d23bd553246 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -533,7 +533,7 @@ var UserList = { if (quota === 'other') { return; } - if ((quota !== 'default' && quota !=="none") && (isNaN(parseInt(quota, 10)) || parseInt(quota, 10) < 0)) { + if ((quota !== 'default' && quota !=="none") && (!OC.Util.computerFileSize(quota))) { // 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})); -- cgit v1.2.3