http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90099

Revision: 90099
Author:   krinkle
Date:     2011-06-14 23:29:45 +0000 (Tue, 14 Jun 2011)
Log Message:
-----------
Only define 'isMainPage' if we are on the main page, the new mw.config library 
is specifically built for this efficient way of exporting variables as it will 
prevent any TypeError exceptions and simply return null (it's not a real global 
anymore).

This is a follow-up on Brion's CR at r87212. 

Modified Paths:
--------------
    trunk/phase3/includes/OutputPage.php

Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php        2011-06-14 23:24:08 UTC (rev 
90098)
+++ trunk/phase3/includes/OutputPage.php        2011-06-14 23:29:45 UTC (rev 
90099)
@@ -2678,7 +2678,6 @@
                        '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 @@
                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 ) );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to