From: Jens Frank Date: Sun, 3 Oct 2004 09:53:39 +0000 (+0000) Subject: Fixes needed to make redirect.php work with MEDIAWIKI checks, X-Git-Tag: 1.5.0alpha1~1669 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=39f1d761c90a844417341c85c07d7dac1441f8e9;p=lhc%2Fweb%2Fwiklou.git Fixes needed to make redirect.php work with MEDIAWIKI checks, i18n and without explicitely set include_path --- diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 271d41d02e..3204346ac2 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -115,7 +115,9 @@ class WebRequest { strncmp($wgServer, $_SERVER['HTTP_REFERER'], strlen( $wgServer ) ) ) ) { # For links that came from outside, check for alternate/legacy # character encoding. - $data = $wgContLang->checkTitleEncoding( $data ); + if ( isset( $wgContLang ) ) { + $data = $wgContLang->checkTitleEncoding( $data ); + } } if( !$wgUseLatin1 ) { require_once( 'normal/UtfNormal.php' ); diff --git a/redirect.php b/redirect.php index 6b69aee824..2f50814af3 100644 --- a/redirect.php +++ b/redirect.php @@ -2,11 +2,12 @@ unset( $DP ); unset( $IP ); $wgCommandLineMode = false; +define( "MEDIAWIKI", true ); require_once( "./LocalSettings.php" ); global $wgArticlePath; -require_once( "WebRequest.php" ); +require_once( "includes/WebRequest.php" ); $wgRequest = new WebRequest(); $page = $wgRequest->getVal( "wpDropdown" );