r79347 didn't update other callers to mungeQuery(), so let's just take the easy way...
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 31 Dec 2010 16:53:01 +0000 (16:53 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 31 Dec 2010 16:53:01 +0000 (16:53 +0000)
includes/specials/SpecialLinkSearch.php

index 50a6242..df8fca5 100644 (file)
@@ -114,12 +114,13 @@ class LinkSearchPage extends QueryPage {
        /**
         * Return an appropriately formatted LIKE query and the clause
         */
-       static function mungeQuery( $query, $prot, $dbr ) {
+       static function mungeQuery( $query, $prot ) {
                $field = 'el_index';
                $rv = LinkFilter::makeLikeArray( $query , $prot );
                if ( $rv === false ) {
                        // LinkFilter doesn't handle wildcard in IP, so we'll have to munge here.
                        if (preg_match('/^(:?[0-9]{1,3}\.)+\*\s*$|^(:?[0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]*\*\s*$/', $query)) {
+                               $dbr = wfGetDB( DB_SLAVE );
                                $rv = array( $prot . rtrim( $query, " \t*" ), $dbr->anyString() );
                                $field = 'el_to';
                        }
@@ -143,7 +144,7 @@ class LinkSearchPage extends QueryPage {
                // strip everything past first wildcard, so that
                // index-based-only lookup would be done
                list( $this->mMungedQuery, $clause ) = self::mungeQuery(
-                               $this->mQuery, $this->mProt, $dbr );
+                               $this->mQuery, $this->mProt );
                if( $this->mMungedQuery === false )
                        // Invalid query; return no results
                        return array( 'tables' => 'page', 'fields' => 'page_id', 'conds' => '0=1' );