From ec80d6d43a890758e8e590d7644e64eec592e5e8 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 31 Dec 2010 16:53:01 +0000 Subject: [PATCH] r79347 didn't update other callers to mungeQuery(), so let's just take the easy way out and obtain $dbr inside the function so we don't have to change the parameter list --- includes/specials/SpecialLinkSearch.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 50a6242b15..df8fca5af3 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -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' ); -- 2.20.1