* Main wiki script; see docs/design.txt
* @package MediaWiki
*/
-
$wgRequestTime = microtime();
+$wgRUstart = getrusage();
unset( $IP );
@ini_set( 'allow_url_fopen', 0 ); # For security...
# 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())
}
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' );
unset($wgArticle);
require_once( 'includes/ImagePage.php' );
$wgArticle = new ImagePage( $wgTitle );
- } elseif ( $wgUseCategoryMagic && $ns == NS_CATEGORY ) {
+ } elseif ( $ns == NS_CATEGORY ) {
unset($wgArticle);
require_once( 'includes/CategoryPage.php' );
$wgArticle = new CategoryPage( $wgTitle );
wfProfileOut( 'main-cleanup' );
+wfProfileClose();
logProfilingData();
$wgLoadBalancer->closeAll();
wfDebug( "Request ended normally\n" );