removing print_r *hides
[lhc/web/wiklou.git] / index.php
index 8655997..3eb2572 100644 (file)
--- a/index.php
+++ b/index.php
@@ -48,7 +48,7 @@ wfProfileOut( "main-misc-setup" );
 # 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())
-if ( !$wgTitle->userCanRead() ) {
+if ( !is_null( $wgTitle ) && !$wgTitle->userCanRead() ) {
        $wgOut->loginToUse();
        $wgOut->output();
        exit;
@@ -77,6 +77,9 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
        /* redirect to canonical url, make it a 301 to allow caching */
        $wgOut->redirect( $wgTitle->getFullURL(), '301');
 } else if ( Namespace::getSpecial() == $wgTitle->getNamespace() ) {
+       # actions that need to be made when we have a special pages
+       require_once( 'includes/SpecialPage.php' );
+       if ( !$wgAllowSysopQueries ) {SpecialPage::removePage( 'Asksql' ); }
        SpecialPage::executePath( $wgTitle );
 } else {
        if ( Namespace::getMedia() == $wgTitle->getNamespace() ) {
@@ -151,6 +154,7 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
                case "purge":
                        wfPurgeSquidServers(array($wgTitle->getInternalURL()));
                        $wgOut->setSquidMaxage( $wgSquidMaxage );
+                       $wgTitle->invalidateCache();
                        $wgArticle->view();
                        break;
                default: