mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +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:
parent
fc25fe694a
commit
ac56b71c3e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user