X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fuser%2FLocalIdLookup.php;h=ca3db5b07d505d19038beee9717e9aeb519f28b6;hb=529143e4aa1bf708bb749857c2e03358ee67fe65;hp=0d8b1a8ede9025162b4ec5e65d37e38f5a4f4830;hpb=c24cbb13dfa35274adc1a6ab11a5ebf38fe5c7d9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/user/LocalIdLookup.php b/includes/user/LocalIdLookup.php index 0d8b1a8ede..ca3db5b07d 100644 --- a/includes/user/LocalIdLookup.php +++ b/includes/user/LocalIdLookup.php @@ -41,7 +41,7 @@ class LocalIdLookup extends CentralIdLookup { } // Easy case, we're checking locally - if ( $wikiId === null || $wikiId === wfWikiID() ) { + if ( $wikiId === null || WikiMap::isCurrentWikiId( $wikiId ) ) { return true; } @@ -60,10 +60,8 @@ class LocalIdLookup extends CentralIdLookup { } $audience = $this->checkAudience( $audience ); - $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_REPLICA ); - $options = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING ) - ? [ 'LOCK IN SHARE MODE' ] - : []; + list( $index, $options ) = DBAccessObjectUtils::getDBOptions( $flags ); + $db = wfGetDB( $index ); $tables = [ 'user' ]; $fields = [ 'user_id', 'user_name' ]; @@ -93,10 +91,8 @@ class LocalIdLookup extends CentralIdLookup { } $audience = $this->checkAudience( $audience ); - $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_REPLICA ); - $options = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING ) - ? [ 'LOCK IN SHARE MODE' ] - : []; + list( $index, $options ) = DBAccessObjectUtils::getDBOptions( $flags ); + $db = wfGetDB( $index ); $tables = [ 'user' ]; $fields = [ 'user_id', 'user_name' ];