From: Brion Vibber Date: Mon, 6 Sep 2004 03:17:21 +0000 (+0000) Subject: Quick fix for canonical redirects when the URL is case-converted. X-Git-Tag: 1.5.0alpha1~2096 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=b59b2ef01a835b42d90c74371d0a6b6a36f8a4cf;p=lhc%2Fweb%2Fwiklou.git Quick fix for canonical redirects when the URL is case-converted. Since this is now done in WebRequest, $title is already converted so check $_GET directly. The canonical redirect still does not handle the case of an index.php?title=Foo URL where $wgArticlePath is set for pretty URLs. --- diff --git a/index.php b/index.php index 411fec21f3..755e04ae6b 100644 --- a/index.php +++ b/index.php @@ -80,8 +80,9 @@ if( !is_null( $search ) && $search !== '' ) { $wgTitle = Title::newFromText( wfMsg( "badtitle" ) ); $wgOut->errorpage( "badtitle", "badtitletext" ); } -} else if ( ( $action == "view" ) && $wgTitle->getPrefixedDBKey() != $title && - !count( array_diff( array_keys( $_GET ), array( 'action', 'title' ) ) ) ) +} else if ( ( $action == "view" ) && + (!isset( $_GET['title'] ) || $wgTitle->getPrefixedDBKey() != $_GET['title'] ) && + !count( array_diff( array_keys( $_GET ), array( 'action', 'title' ) ) ) ) { /* redirect to canonical url, make it a 301 to allow caching */ $wgOut->redirect( $wgTitle->getFullURL(), '301');