From 25a2013890c7e07b4621fa9b18342e7f35363049 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Mon, 31 Jul 2017 19:45:35 +0100 Subject: PLT-6603: Don't return all posts on invalid query. (#7061) If the query contains only * or invalid punctuation only components, don't return all posts - instead return no results. This also fixes PLT-6608 --- app/post.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/post.go b/app/post.go index c40eab0e8..ee28fbbf7 100644 --- a/app/post.go +++ b/app/post.go @@ -532,6 +532,11 @@ func SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bo } } + // If the processed search params are empty, return empty search results. + if len(finalParamsList) == 0 { + return model.NewPostList(), nil + } + // We only allow the user to search in channels they are a member of. userChannels, err := GetChannelsForUser(teamId, userId) if err != nil { -- cgit v1.2.3-1-g7c22