/**
* 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';
}
// 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' );