Convert null global to false

Bug: T270147
Change-Id: I7b6d3bae126d7a1dc57eaf9ab0aef070595910e0
This commit is contained in:
Ed Sanders 2020-12-16 17:43:59 +00:00 committed by Reedy
parent 53bb01d46a
commit 60714e7a81

View file

@ -86,9 +86,11 @@ class UpdateTables {
*/
private static function getDatabase() {
global $wgOATHAuthDatabase;
// Global can be `null` during installation, ensure we pass `false` instead (T270147)
$database = $wgOATHAuthDatabase ?? false;
$lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory()
->getMainLB( $wgOATHAuthDatabase );
return $lb->getConnectionRef( DB_MASTER, [], $wgOATHAuthDatabase );
->getMainLB( $database );
return $lb->getConnectionRef( DB_MASTER, [], $database );
}
/**