Only define 'isMainPage' if we are on the main page, the new mw.config library is...
authorKrinkle <krinkle@users.mediawiki.org>
Tue, 14 Jun 2011 23:29:45 +0000 (23:29 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Tue, 14 Jun 2011 23:29:45 +0000 (23:29 +0000)
This is a follow-up on Brion's CR at r87212.

includes/OutputPage.php

index a9e17bb..cc7a8a6 100644 (file)
@@ -2678,7 +2678,6 @@ class OutputPage {
                        'wgUserGroups' => $this->getUser()->getEffectiveGroups(),
                        'wgCategories' => $this->getCategories(),
                        'wgBreakFrames' => $this->getFrameOptions() == 'DENY',
-                       'wgIsMainPage' => $title->isMainPage(),
                );
                if ( $wgContLang->hasVariants() ) {
                        $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
@@ -2689,6 +2688,9 @@ class OutputPage {
                if ( $wgUseAjax && $wgEnableMWSuggest && !$this->getUser()->getOption( 'disablesuggest', false ) ) {
                        $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $this->getUser() );
                }
+               if ( $title->isMainPage() ) {
+                       $vars['wgIsMainPage'] = $title->isMainPage();
+               }
 
                // Allow extensions to add their custom variables to the global JS variables
                wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars ) );