From 0790125dd441ff24a2a9f47501eef1e510689fa4 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 12 Nov 2015 10:38:04 -0800 Subject: [PATCH] Don't export unused wgEchoOverlayConfiguration/wgEchoHelpPage JS variables And make the if conditional a little easier to read: is logged in versus not anonymous. Change-Id: I76784b74caabd1ea0a5f0f506661a1682c865394 --- Hooks.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Hooks.php b/Hooks.php index ea489d7ba..00e4842fe 100644 --- a/Hooks.php +++ b/Hooks.php @@ -812,17 +812,12 @@ class EchoHooks { * @return bool true in all cases */ public static function makeGlobalVariablesScript( &$vars, OutputPage $outputPage ) { - global $wgEchoHelpPage, $wgEchoMaxNotificationCount, $wgEchoConfig; + global $wgEchoConfig; $user = $outputPage->getUser(); // Provide info for the Overlay - if ( !$user->isAnon() ) { - $vars['wgEchoOverlayConfiguration'] = array( - 'notification-count' => MWEchoNotifUser::newFromUser( $user )->getFormattedNotificationCount(), - 'max-notification-count' => $wgEchoMaxNotificationCount, - ); - $vars['wgEchoHelpPage'] = $wgEchoHelpPage; + if ( $user->isLoggedIn() ) { $vars['wgEchoConfig'] = $wgEchoConfig; } elseif ( $outputPage->getTitle()->equals( SpecialPage::getTitleFor( 'JavaScriptTest', 'qunit' ) ) ||