$wgArticle = new Article($wgTitle);
$action = strtolower( trim( $action ) );
-if ( "" == $action ) { $action = "view"; }
if ($wgRequest->getVal( "printable" ) == "yes") {
$wgOut->setPrintable();
}
# 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;
} else if ( $wgTitle->getInterwiki() != "" ) {
$url = $wgTitle->getFullURL();
# Check for a redirect loop
- if ( !preg_match( "/^" . preg_quote( $wgServer ) . "/", $url ) && $wgTitle->isLocal() ) {
+ if ( !preg_match( "/^" . preg_quote( $wgServer, "/" ) . "/", $url ) && $wgTitle->isLocal() ) {
$wgOut->redirect( $url );
} else {
$wgTitle = Title::newFromText( wfMsg( "badtitle" ) );
/* redirect to canonical url, make it a 301 to allow caching */
$wgOut->redirect( $wgTitle->getFullURL(), '301');
} else if ( Namespace::getSpecial() == $wgTitle->getNamespace() ) {
- wfSpecialPage();
+ # 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() ) {
$wgTitle = Title::makeTitle( Namespace::getImage(), $wgTitle->getDBkey() );
case "purge":
wfPurgeSquidServers(array($wgTitle->getInternalURL()));
$wgOut->setSquidMaxage( $wgSquidMaxage );
+ $wgTitle->invalidateCache();
$wgArticle->view();
break;
default: