fix for bug 22929: disable gadgets on Special:Userlogin

This commit is contained in:
Daniel Kinzler 2010-04-06 21:00:39 +00:00
parent dc06d8be5d
commit 1ff985a53e

View file

@ -161,8 +161,15 @@ function wfGadgetsBeforePageDisplay( &$out ) {
global $wgUser; global $wgUser;
if ( !$wgUser->isLoggedIn() ) return true; if ( !$wgUser->isLoggedIn() ) return true;
//disable all gadgets on Special:Preferences //disable all gadgets on critical special pages
if ( $out->getTitle()->isSpecial( 'Preferences' ) ) { //NOTE: $out->isUserJsAllowed() is tempting, but always fals if $wgAllowUserJs is false.
// That would disable gadgets on wikis without user JS. Introducing $out->isJsAllowed()
// may work, but should that really apply also to MediaWiki:common.js? Even on the preference page?
// See bug 22929 for discussion.
$title = $out->getTitle();
if ( $title->isSpecial( 'Preferences' )
|| $title->isSpecial( 'Resetpass' )
|| $title->isSpecial( 'Userlogin' ) ) {
return true; return true;
} }