From 6333fe241c8e2181c6c537755d874eaa75eca4df Mon Sep 17 00:00:00 2001 From: Danny B Date: Mon, 7 Dec 2009 18:28:25 +0000 Subject: [PATCH] * (bug 21776) Empty project + language interwikis do not work anymore [patch by Platonides] --- RELEASE-NOTES | 1 + includes/Wiki.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index af9b47236f..402eff3741 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -669,6 +669,7 @@ Hopefully we will remove this configuration var soon) * (bug 21559) "logempty" message is now wrapped in a div with class "mw-warning-logempty" when used in log extract * (bug 20549) Parser tests were broken on SQLite backend +* (bug 21776) Interwiki urls like http://en.wikibooks.org/wiki/cs: should give a redirect instead of a baderror. == API changes in 1.16 == diff --git a/includes/Wiki.php b/includes/Wiki.php index faeb6e84a1..631cd03931 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -182,11 +182,13 @@ class MediaWiki { global $wgContLang, $wgUser; $action = $this->getVal( 'Action' ); $perferred = $wgContLang->getPreferredVariant( false ); - // Invalid titles - if( is_null($title) || $title->getDBkey() == '' ) { + + // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty. + if( is_null($title) || ( ($title->getDBkey() == '') && ($title->getInterwiki() == '') ) ) { $title = SpecialPage::getTitleFor( 'Badtitle' ); # Die now before we mess up $wgArticle and the skin stops working throw new ErrorPageError( 'badtitle', 'badtitletext' ); + // Interwiki redirects } else if( $title->getInterwiki() != '' ) { if( $rdfrom = $request->getVal( 'rdfrom' ) ) { -- 2.20.1