$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() ) {