ForeignWikiRequest: Also check User::isSafeToLoad()

Check it for both $wgUser and $this->user because they
could theoretically be different.

Bug: T139665
Change-Id: I59cb4f0122a9fccb32ca165fda065dee2467b1da
This commit is contained in:
Roan Kattouw 2016-07-18 14:49:43 -07:00
parent d27cab59d6
commit 83a181ce9c

View file

@ -38,9 +38,11 @@ class EchoForeignWikiRequest {
}
protected function canUseCentralAuthl() {
global $wgFullyInitialised;
global $wgFullyInitialised, $wgUser;
return $wgFullyInitialised &&
$wgUser->isSafeToLoad() &&
$this->user->isSafeToLoad() &&
SessionManager::getGlobalSession()->getProvider() instanceof CentralAuthSessionProvider &&
$this->getCentralId( $this->user ) !== 0;
}