X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fsearch%2FSearchMySQL.php;h=77dcfe9ce2aad9e1e6f6fe054faec3706cc45ede;hp=36cbbaa8564e7dd4ad7704e6897bdd6c1aae1a60;hb=3df3b575c6617df64ec98533cc7141bd2314e274;hpb=a5be382adfdad4678eec18413c6a118cb3284daf diff --git a/includes/search/SearchMySQL.php b/includes/search/SearchMySQL.php index 36cbbaa856..77dcfe9ce2 100644 --- a/includes/search/SearchMySQL.php +++ b/includes/search/SearchMySQL.php @@ -45,7 +45,7 @@ class SearchMySQL extends SearchDatabase { function parseQuery( $filteredText, $fulltext ) { global $wgContLang; - $lc = $this->legalSearchChars(); // Minus format chars + $lc = $this->legalSearchChars( self::CHARS_NO_SYNTAX ); // Minus syntax chars (" and *) $searchon = ''; $this->searchTerms = []; @@ -149,8 +149,13 @@ class SearchMySQL extends SearchDatabase { return $regex; } - public static function legalSearchChars() { - return "\"*" . parent::legalSearchChars(); + public static function legalSearchChars( $type = self::CHARS_ALL ) { + $searchChars = parent::legalSearchChars( $type ); + if ( $type === self::CHARS_ALL ) { + // " for phrase, * for wildcard + $searchChars = "\"*" . $searchChars; + } + return $searchChars; } /** @@ -213,7 +218,7 @@ class SearchMySQL extends SearchDatabase { /** * Add special conditions - * @param array $query + * @param array &$query * @since 1.18 */ protected function queryFeatures( &$query ) { @@ -226,7 +231,7 @@ class SearchMySQL extends SearchDatabase { /** * Add namespace conditions - * @param array $query + * @param array &$query * @since 1.18 (changed) */ function queryNamespaces( &$query ) { @@ -240,7 +245,7 @@ class SearchMySQL extends SearchDatabase { /** * Add limit options - * @param array $query + * @param array &$query * @since 1.18 */ protected function limitResult( &$query ) {