From 01eebd6511ec5a381422a707387355aab6d87fa8 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 18 Aug 2012 00:26:36 +0530 Subject: [PATCH] [ticket/11177] return no results when query has only negation If search query has only -foo then instead of displaying all results that do not have foo, should display no results found. PHPBB3-11177 --- phpBB/includes/search/fulltext_postgres.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php index 38989a9d9a..dc8b9e3a15 100644 --- a/phpBB/includes/search/fulltext_postgres.php +++ b/phpBB/includes/search/fulltext_postgres.php @@ -281,6 +281,12 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base return false; } + // When search query contains queries like -foo + if (strpos($this->search_query, '+') === false) + { + return false; + } + // generate a search_key from all the options to identify the results $search_key = md5(implode('#', array( implode(', ', $this->split_words),