X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fuser%2FLocalIdLookup.php;h=ca3db5b07d505d19038beee9717e9aeb519f28b6;hp=0d8b1a8ede9025162b4ec5e65d37e38f5a4f4830;hb=dcd0a3d53;hpb=196db3429307c04e5c92f6c06a965a394d4a8a87 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' ];