Merge "Consistently handle anonymous users on logged-in-only special pages"
[lhc/web/wiklou.git] / includes / SpecialPage.php
index 3aea4d9..9fb39da 100644 (file)
@@ -259,11 +259,7 @@ class SpecialPage {
         */
        public static function getTitleFor( $name, $subpage = false, $fragment = '' ) {
                $name = SpecialPageFactory::getLocalNameFor( $name, $subpage );
-               if ( $name ) {
-                       return Title::makeTitle( NS_SPECIAL, $name, $fragment );
-               } else {
-                       throw new MWException( "Invalid special page name \"$name\"" );
-               }
+               return Title::makeTitle( NS_SPECIAL, $name, $fragment );
        }
 
        /**
@@ -880,12 +876,10 @@ class SpecialPage {
         * @see wfMessage
         */
        public function msg( /* $args */ ) {
-               // Note: can't use func_get_args() directly as second or later item in
-               // a parameter list until PHP 5.3 or you get a fatal error.
-               // Works fine as the first parameter, which appears elsewhere in the
-               // code base. Sighhhh.
-               $args = func_get_args();
-               $message = call_user_func_array( array( $this->getContext(), 'msg' ), $args );
+               $message = call_user_func_array(
+                       array( $this->getContext(), 'msg' ),
+                       func_get_args()
+               );
                // RequestContext passes context to wfMessage, and the language is set from
                // the context, but setting the language for Message class removes the
                // interface message status, which breaks for example usernameless gender
@@ -924,7 +918,6 @@ class SpecialPage {
        public function getFinalGroupName() {
                global $wgSpecialPageGroups;
                $name = $this->getName();
-               $group = '-';
 
                // Allow overbidding the group from the wiki side
                $msg = $this->msg( 'specialpages-specialpagegroup-' . strtolower( $name ) )->inContentLanguage();