mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 05:48:51 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -122,7 +122,7 @@ class fulltext_mysql extends search_backend
|
||||||
|
|
||||||
if ($terms == 'all')
|
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(' +', ' |', ' -', ' +', ' -', ' |');
|
$replace = array(' +', ' |', ' -', ' +', ' -', ' |');
|
||||||
|
|
||||||
$keywords = preg_replace($match, $replace, $keywords);
|
$keywords = preg_replace($match, $replace, $keywords);
|
||||||
|
|
Loading…
Add table
Reference in a new issue