Index: trunk/phase3/includes/specials/SpecialLinkSearch.php |
— | — | @@ -114,12 +114,13 @@ |
115 | 115 | /** |
116 | 116 | * Return an appropriately formatted LIKE query and the clause |
117 | 117 | */ |
118 | | - static function mungeQuery( $query, $prot, $dbr ) { |
| 118 | + static function mungeQuery( $query, $prot ) { |
119 | 119 | $field = 'el_index'; |
120 | 120 | $rv = LinkFilter::makeLikeArray( $query , $prot ); |
121 | 121 | if ( $rv === false ) { |
122 | 122 | // LinkFilter doesn't handle wildcard in IP, so we'll have to munge here. |
123 | 123 | if (preg_match('/^(:?[0-9]{1,3}\.)+\*\s*$|^(:?[0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]*\*\s*$/', $query)) { |
| 124 | + $dbr = wfGetDB( DB_SLAVE ); |
124 | 125 | $rv = array( $prot . rtrim( $query, " \t*" ), $dbr->anyString() ); |
125 | 126 | $field = 'el_to'; |
126 | 127 | } |
— | — | @@ -143,7 +144,7 @@ |
144 | 145 | // strip everything past first wildcard, so that |
145 | 146 | // index-based-only lookup would be done |
146 | 147 | list( $this->mMungedQuery, $clause ) = self::mungeQuery( |
147 | | - $this->mQuery, $this->mProt, $dbr ); |
| 148 | + $this->mQuery, $this->mProt ); |
148 | 149 | if( $this->mMungedQuery === false ) |
149 | 150 | // Invalid query; return no results |
150 | 151 | return array( 'tables' => 'page', 'fields' => 'page_id', 'conds' => '0=1' ); |