* (bug 21776) Empty project + language interwikis do not work anymore [patch by Plato...
authorDanny B <danny_b@users.mediawiki.org>
Mon, 7 Dec 2009 18:28:25 +0000 (18:28 +0000)
committerDanny B <danny_b@users.mediawiki.org>
Mon, 7 Dec 2009 18:28:25 +0000 (18:28 +0000)
RELEASE-NOTES
includes/Wiki.php

index af9b472..402eff3 100644 (file)
@@ -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 ==
 
index faeb6e8..631cd03 100644 (file)
@@ -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' ) ) {