From: Brion Vibber Date: Wed, 16 Nov 2005 21:31:41 +0000 (+0000) Subject: * Recognize Special:Search consistently so read whitelist works X-Git-Tag: 1.6.0~1161 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=ee402472acd435da3dd8bc3e08388bd2045f45f9;p=lhc%2Fweb%2Fwiklou.git * Recognize Special:Search consistently so read whitelist works --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fb25c17383..576ffdccd3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -234,6 +234,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 3961) minor languageDe changes * (bug 1984) LanguageKo.php (Korean) update * (bug 3804) update of LanguageWa.php file +* Recognize Special:Search consistently so read whitelist works === Caveats === diff --git a/index.php b/index.php index da837c9b39..dd9d9eb4cf 100644 --- a/index.php +++ b/index.php @@ -95,6 +95,13 @@ wfProfileOut( 'main-misc-setup' ); # Debug statement for user levels // print_r($wgUser); +$search = $wgRequest->getText( 'search' ); +if( !is_null( $search ) && $search !== '' ) { + // Compatibility with old search URLs which didn't use Special:Search + // Do this above the read whitelist check for security... + $wgTitle = Title::makeTitle( NS_SPECIAL, 'Search' ); +} + # If the user is not logged in, the Namespace:title of the article must be in # the Read array in order for the user to see it. (We have to check here to # catch special pages etc. We check again in Article::view()) @@ -105,10 +112,6 @@ if ( !is_null( $wgTitle ) && !$wgTitle->userCanRead() ) { } wfProfileIn( 'main-action' ); -$search = $wgRequest->getText( 'search' ); -if( $wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) { - $wgTitle = Title::makeTitle( NS_SPECIAL, 'Search' ); -} if( !$wgDisableInternalSearch && !is_null( $search ) && $search !== '' ) { require_once( 'includes/SpecialSearch.php' );