From e3dad1f942137234b003839655b76258acb61977 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 3 Oct 2011 14:04:43 +0000 Subject: [PATCH] Also catch Special:Badtitle to display the "Bad title" error message since this is now how it is passed in the context object. When such error occured, the user was redirected to Special:Badtitle and got the "Special page does not exist" message. --- includes/Wiki.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index 649fb13748..0755a09b3b 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -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 -- 2.20.1