From 8e3d0fecd237a457fe66e00bc293923dae9a5adf Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 21 Feb 2017 17:22:06 -0600 Subject: Use intval() for validation of config options Signed-off-by: Morris Jobke --- core/js/sharedialogview.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index bbc40c9c8d4..6a92c6a8dd5 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -267,7 +267,10 @@ // show a notice that the list is truncated // this is the case if one of the search results is at least as long as the max result config option - if(Math.min(perPage, oc_config['sharing.maxAutocompleteResults']) <= Math.max(users.length, groups.length, remotes.length, emails.length, lookup.length)) { + if(oc_config['sharing.maxAutocompleteResults'] > 0 && + Math.min(perPage, oc_config['sharing.maxAutocompleteResults']) + <= Math.max(users.length, groups.length, remotes.length, emails.length, lookup.length)) { + var message = t('core', 'This list is maybe truncated - please refine your search term to see more results.'); $('.ui-autocomplete').append('
  • ' + message + '
  • '); } -- cgit v1.2.3