From 2b959e3331f9bb585c115911e027844afe54d1e6 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 5 Oct 2013 21:09:52 +0530 Subject: [PATCH] [ticket/11288] Handle +,- without preceeding whitespace characters PHPBB3-11288 --- phpBB/includes/search/fulltext_native.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index dc961f3c8a..7fff83db58 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -233,6 +233,12 @@ class fulltext_native extends search_backend } unset($exact_words); + // Handle +, - without preceeding whitespace character + $match = array('#(\S)\+#', '#(\S)-#'); + $replace = array('$1 +', '$1 +'); + + $keywords = preg_replace($match, $replace, $keywords); + // now analyse the search query, first split it using the spaces $query = explode(' ', $keywords);