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 = [];
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;
}
/**
/**
* Add special conditions
- * @param array $query
+ * @param array &$query
* @since 1.18
*/
protected function queryFeatures( &$query ) {
/**
* Add namespace conditions
- * @param array $query
+ * @param array &$query
* @since 1.18 (changed)
*/
function queryNamespaces( &$query ) {
/**
* Add limit options
- * @param array $query
+ * @param array &$query
* @since 1.18
*/
protected function limitResult( &$query ) {