mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Remove use of global $wgUser
This partially reverts commit83a181ce9c
and fully reverts82896eff62
To avoid regressing to the errors from T139665, check if the user retrieved from RequestContext::getMain()->getUser() is safe to load instead of $wgUser, still in addition to the other checks that EchoForeignWikiRequest::$user is safe to load. Bug: T243732 Change-Id: I22c4918fc7e8b3d1364a95de3958c055059971b8
This commit is contained in:
parent
9cf347019b
commit
3269afae8e
|
@ -66,11 +66,10 @@ class EchoForeignWikiRequest {
|
|||
}
|
||||
|
||||
protected function canUseCentralAuth() {
|
||||
// phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgUser
|
||||
global $wgFullyInitialised, $wgUser;
|
||||
global $wgFullyInitialised;
|
||||
|
||||
return $wgFullyInitialised &&
|
||||
$wgUser->isSafeToLoad() &&
|
||||
RequestContext::getMain()->getUser()->isSafeToLoad() &&
|
||||
$this->user->isSafeToLoad() &&
|
||||
SessionManager::getGlobalSession()->getProvider() instanceof CentralAuthSessionProvider &&
|
||||
$this->getCentralId( $this->user ) !== 0;
|
||||
|
|
Loading…
Reference in a new issue