Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F585285
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
960 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php
index 55445051106..d5d39ce0cc4 100644
--- a/includes/search/SearchMySQL.php
+++ b/includes/search/SearchMySQL.php
@@ -162,6 +162,17 @@ class SearchMySQL extends SearchDatabase {
public function legalSearchChars( $type = self::CHARS_ALL ) {
$searchChars = parent::legalSearchChars( $type );
+
+ // In the MediaWiki UI, search strings containing (just) a hyphen are translated into
+ // MATCH(si_title) AGAINST('+- ' IN BOOLEAN MODE)
+ // which is not valid.
+
+ // From <https://dev.mysql.com/doc/refman/8.0/en/fulltext-boolean.html>:
+ // "InnoDB full-text search does not support... a plus and minus sign combination ('+-')"
+
+ // See also https://phabricator.wikimedia.org/T221560
+ $searchChars = preg_replace( '/\\\\-/', '', $searchChars );
+
if ( $type === self::CHARS_ALL ) {
// " for phrase, * for wildcard
$searchChars = "\"*" . $searchChars;
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:32 AM (18 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227693
Default Alt Text
(960 B)
Attached To
Mode
rMW mediawiki
Attached
Detach File
Event Timeline
Log In to Comment