Also catch Special:Badtitle to display the "Bad title" error message since this is...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 3 Oct 2011 14:04:43 +0000 (14:04 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 3 Oct 2011 14:04:43 +0000 (14:04 +0000)
includes/Wiki.php

index 649fb13..0755a09 100644 (file)
@@ -147,8 +147,10 @@ class MediaWiki {
                        array( &$title, null, &$output, &$user, $request, $this ) );
 
                // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
-               if ( is_null( $title ) || ( ( $title->getDBkey() == '' ) && ( $title->getInterwiki() == '' ) ) ) {
-                       $this->context->title = SpecialPage::getTitleFor( 'Badtitle' );
+               if ( is_null( $title ) || ( $title->getDBkey() == '' && $title->getInterwiki() == '' ) ||
+                       $title->isSpecial( 'Badtitle' ) )
+               {
+                       $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
                        throw new ErrorPageError( 'badtitle', 'badtitletext' );
                // If the user is not logged in, the Namespace:title of the article must be in
                // the Read array in order for the user to see it. (We have to check here to