r98764 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98763‎ | r98764 | r98765 >
Date:14:04, 3 October 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -147,8 +147,10 @@
148148 array( &$title, null, &$output, &$user, $request, $this ) );
149149
150150 // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
151 - if ( is_null( $title ) || ( ( $title->getDBkey() == '' ) && ( $title->getInterwiki() == '' ) ) ) {
152 - $this->context->title = SpecialPage::getTitleFor( 'Badtitle' );
 151+ if ( is_null( $title ) || ( $title->getDBkey() == '' && $title->getInterwiki() == '' ) ||
 152+ $title->isSpecial( 'Badtitle' ) )
 153+ {
 154+ $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) );
153155 throw new ErrorPageError( 'badtitle', 'badtitletext' );
154156 // If the user is not logged in, the Namespace:title of the article must be in
155157 // the Read array in order for the user to see it. (We have to check here to

Follow-up revisions

RevisionCommit summaryAuthorDate
r102202Bug 31886: Wrong titles redirecting to Special:Badtitle in the 1.18 deployment...platonides22:59, 6 November 2011
r1025881.18wmf1 MFT r92846, r98764, r99477reedy22:51, 9 November 2011

Comments

#Comment by Dantman (talk | contribs)   22:46, 6 November 2011

Platonides helped identify this as the fix which affects 1.18 and should be backported. I believe this affects WMF sites too so tagging it there as well.

Status & tagging log