From 71fa451856761b6bb540f1367b33749de6187e81 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 21 Aug 2018 16:54:26 -0400 Subject: [PATCH] Enforece SOGoSearchMinimumWordLength server-side Fixes #4525 --- UI/Contacts/UIxContactFoldersView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index 941603b5c..a525f27b5 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -164,7 +164,7 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK; BOOL excludeGroups, excludeLists; searchText = [self queryParameterForKey: @"search"]; - if ([searchText length] > 0) + if ([searchText length] >= [self minimumSearchLength]) { // NSLog(@"Search all contacts: %@", searchText); excludeGroups = [[self queryParameterForKey: @"excludeGroups"] boolValue]; @@ -251,7 +251,7 @@ Class SOGoContactSourceFolderK, SOGoGCSFolderK; } else result = [NSException exceptionWithHTTPStatus: 400 - reason: @"missing 'search' parameter"]; + reason: [NSString stringWithFormat: @"'search' parameter must be at least %i characters", [self minimumSearchLength]]]; return result; }