From ac56b71c3ede46ab839ff77a0b324ef746d90cb0 Mon Sep 17 00:00:00 2001 From: Josh Woody Date: Thu, 29 Jul 2010 10:13:17 -0500 Subject: [PATCH] [ticket/9749] Fulltext mysql unexpected behavior on entering a dash in query The Fulltext_mysql class had different behavior when a dash was entered in the search query than the fulltext_native class. Specifically, a dash was automatically turned into boolean NOT even when the user wanted to search for legitimate hyphenated words like farty-pants PHPBB3-9749 --- phpBB/includes/search/fulltext_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index da3833754e..0be3a10e5f 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -122,7 +122,7 @@ class fulltext_mysql extends search_backend if ($terms == 'all') { - $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#\+#', '#-#', '#\|#'); + $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#(^|\s)\+#', '#(^|\s)-#', '#(^|\s)\|#'); $replace = array(' +', ' |', ' -', ' +', ' -', ' |'); $keywords = preg_replace($match, $replace, $keywords);