Use ErrorPageError extension in Special:Preferences.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 19 Aug 2012 08:51:23 +0000 (10:51 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 19 Aug 2012 08:51:23 +0000 (10:51 +0200)
For consistency with other errors, use an exception
when the user is not logged in.

Change-Id: I1a9cc37b57281665a5081ad65bb1e34253c64224

includes/specials/SpecialPreferences.php

index b69354c..c6b2bb6 100644 (file)
@@ -39,8 +39,7 @@ class SpecialPreferences extends SpecialPage {
 
                $user = $this->getUser();
                if ( $user->isAnon() ) {
-                       $out->showErrorPage( 'prefsnologin', 'prefsnologintext', array( $this->getTitle()->getPrefixedDBkey() ) );
-                       return;
+                       throw new ErrorPageError( 'prefsnologin', 'prefsnologintext', array( $this->getTitle()->getPrefixedDBkey() ) );
                }
                $this->checkReadOnly();