From 75ade04dfc8b9b49b7d9fcd4a488795b19707cd0 Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Thu, 13 Aug 2020 15:37:45 +0100 Subject: [PATCH] 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 --- includes/Hooks.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index f1b1560..3d6a0fe 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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() );