From a3033a4a8650e2fcbe8b2e8e9f3044f872c0ea14 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 2ee119ccfe..29c5a72874 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -232,6 +232,12 @@ class fulltext_native extends search_backend $db->sql_freeresult($result); } + // 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);