1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 20:13:22 +01:00

[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
This commit is contained in:
Josh Woody 2010-07-29 10:13:17 -05:00
parent fc25fe694a
commit ac56b71c3e

View File

@ -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);