hooks: Don't send config variables unnecessarily

The wgVectorDisableSidebarPersistence config variable is only required
when the user is logged in. Don't send it to the client when the user is
logged out.

Bug: T255727
Change-Id: I27eda8c18b438ef3251b2c07a0ed8b0cef6cae64
This commit is contained in:
Sam Smith 2020-08-13 15:37:45 +01:00
parent a03a19f7af
commit 75ade04dfc
1 changed files with 4 additions and 2 deletions

View File

@ -295,10 +295,12 @@ class Hooks {
* @param OutputPage $out OutputPage instance calling the hook
*/
public static function onMakeGlobalVariablesScript( &$vars, OutputPage $out ) {
if ( $out->getSkin() instanceof SkinVector ) {
$user = $out->getUser();
if ( $out->getSkin() instanceof SkinVector && $user->isRegistered() ) {
$skinVersionLookup = new SkinVersionLookup(
$out->getRequest(),
$out->getUser(),
$user,
self::getServiceConfig()
);