X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsearch%2FSearchEngine.php;h=56bb0ac9ae789b413919b0864368147ee00f987d;hb=69ae6a4c96b37dbdf962be124f34ce20e2810b9c;hp=907047e9476c28546dff6f2ba0e5c1bef9ecee88;hpb=348a0bead146d133b3773e1b34bc30e524b6c1bb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 907047e947..56bb0ac9ae 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -318,7 +318,6 @@ class SearchEngine { $parsed = $query; if ( strpos( $query, ':' ) === false ) { // nothing to do - wfRunHooks( 'SearchEngineReplacePrefixesComplete', array( $this, $query, &$parsed ) ); return $parsed; } @@ -338,8 +337,6 @@ class SearchEngine { $parsed = $query; // prefix was the whole query } - wfRunHooks( 'SearchEngineReplacePrefixesComplete', array( $this, $query, &$parsed ) ); - return $parsed; } @@ -368,20 +365,8 @@ class SearchEngine { * @return array */ public static function userNamespaces( $user ) { - global $wgSearchEverythingOnlyLoggedIn; - - $searchableNamespaces = SearchEngine::searchableNamespaces(); - - // get search everything preference, that can be set to be read for logged-in users - // it overrides other options - if ( !$wgSearchEverythingOnlyLoggedIn || $user->isLoggedIn() ) { - if ( $user->getOption( 'searcheverything' ) ) { - return array_keys( $searchableNamespaces ); - } - } - $arr = array(); - foreach ( $searchableNamespaces as $ns => $name ) { + foreach ( SearchEngine::searchableNamespaces() as $ns => $name ) { if ( $user->getOption( 'searchNs' . $ns ) ) { $arr[] = $ns; } @@ -431,28 +416,6 @@ class SearchEngine { return $formatted; } - /** - * Return the help namespaces to be shown on Special:Search - * - * @return array - */ - public static function helpNamespaces() { - global $wgNamespacesToBeSearchedHelp; - - return array_keys( $wgNamespacesToBeSearchedHelp, true ); - } - - /** - * Return a 'cleaned up' search string - * - * @param string $text - * @return string - */ - function filter( $text ) { - $lc = $this->legalSearchChars(); - return trim( preg_replace( "/[^{$lc}]/", " ", $text ) ); - } - /** * Load up the appropriate search engine class for the currently * active database backend, and return a configured instance. @@ -578,13 +541,6 @@ class SearchEngine { } } -/** - * @ingroup Search - */ -class SearchResultTooMany { - # # Some search engines may bail out if too many matches are found -} - /** * Dummy class to be used when non-supported Database engine is present. * @todo FIXME: Dummy class should probably try something at least mildly useful,