aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2012-08-18 00:26:36 +0530
committerDhruv <dhruv.goel92@gmail.com>2012-11-09 13:37:01 +0100
commit01eebd6511ec5a381422a707387355aab6d87fa8 (patch)
tree85af9bedf1f8538c3c0cc629d156490ff9b95f41 /phpBB/includes/search
parentf1a692a5f45d993fe2578f13d365ca10543696f8 (diff)
downloadforums-01eebd6511ec5a381422a707387355aab6d87fa8.tar
forums-01eebd6511ec5a381422a707387355aab6d87fa8.tar.gz
forums-01eebd6511ec5a381422a707387355aab6d87fa8.tar.bz2
forums-01eebd6511ec5a381422a707387355aab6d87fa8.tar.xz
forums-01eebd6511ec5a381422a707387355aab6d87fa8.zip
[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
Diffstat (limited to 'phpBB/includes/search')
-rw-r--r--phpBB/includes/search/fulltext_postgres.php6
1 files changed, 6 insertions, 0 deletions
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),