mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-15 03:23:51 +00:00
fix for bug 22929: disable gadgets on Special:Userlogin
This commit is contained in:
parent
dc06d8be5d
commit
1ff985a53e
11
Gadgets.php
11
Gadgets.php
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue