From: Brion Vibber Date: Sun, 27 Feb 2005 09:58:49 +0000 (+0000) Subject: * (bug 563) Fix UTF-8 interwiki URL redirects via Latin-1 wikis X-Git-Tag: 1.5.0alpha1~691 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=eb151b05722a06478195e206e37dcfd08509327d;p=lhc%2Fweb%2Fwiklou.git * (bug 563) Fix UTF-8 interwiki URL redirects via Latin-1 wikis --- 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() ) {