From eb151b05722a06478195e206e37dcfd08509327d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 27 Feb 2005 09:58:49 +0000 Subject: [PATCH] * (bug 563) Fix UTF-8 interwiki URL redirects via Latin-1 wikis --- index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.php b/index.php index 0df55418d1..cbb51377c2 100644 --- a/index.php +++ b/index.php @@ -69,6 +69,12 @@ if( !$wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) { $wgTitle = Title::newFromText( wfMsgForContent( 'badtitle' ) ); $wgOut->errorpage( 'badtitle', 'badtitletext' ); } else if ( $wgTitle->getInterwiki() != '' ) { + if( $wgUseLatin1 ) { + # Conversion from UTF-8 may truncate or corrupt non-Latin links. + # Grab a fresh copy without doing the automated conversion checks. + $interwiki = Title::newFromUrl( $_REQUEST['title'] ); + if( !is_null( $interwiki ) ) $wgTitle = $interwiki; + } $url = $wgTitle->getFullURL(); # Check for a redirect loop if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) && $wgTitle->isLocal() ) { -- 2.20.1