* Recognize Special:Search consistently so read whitelist works
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 16 Nov 2005 21:31:41 +0000 (21:31 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 16 Nov 2005 21:31:41 +0000 (21:31 +0000)
RELEASE-NOTES
index.php

index fb25c17..576ffdc 100644 (file)
@@ -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 ===
index da837c9..dd9d9eb 100644 (file)
--- 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' );