# Query string fields
$action = $wgRequest->getVal( "action", "view" );
-if( isset( $_SERVER['PATH_INFO'] ) ) {
+if( isset( $_SERVER['PATH_INFO'] ) && $wgUsePathInfo ) {
$title = substr( $_SERVER['PATH_INFO'], 1 );
} else {
$title = $wgRequest->getVal( "title" );
wfQuery("BEGIN", DB_WRITE);
switch( $action ) {
case "view":
+ $wgOut->setSquidMaxage( $wgSquidMaxage );
+ $wgArticle->$action();
+ break;
case "watch":
case "unwatch":
case "delete":
case "print":
$wgArticle->view();
break;
+ case "dublincore":
+ if( !$wgEnableDublinCoreRdf ) {
+ wfHttpError( 403, "Forbidden", wfMsg( "nodublincore" ) );
+ } else {
+ include_once( "Metadata.php" );
+ wfDublinCoreRdf( $wgArticle );
+ }
+ break;
+ case "creativecommons":
+ if( !$wgEnableCreativeCommonsRdf ) {
+ wfHttpError( 403, "Forbidden", wfMsg("nocreativecommons") );
+ } else {
+ include_once( "Metadata.php" );
+ wfCreativeCommonsRdf( $wgArticle );
+ }
+ break;
case "edit":
case "submit":
if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) {
$editor->$action();
break;
case "history":
+ if ($_SERVER["REQUEST_URI"] == $wgTitle->getInternalURL('action=history')) {
+ $wgOut->setSquidMaxage( $wgSquidMaxage );
+ }
include_once( "PageHistory.php" );
$history = new PageHistory( $wgArticle );
$history->history();
break;
+ case "purge":
+ wfPurgeSquidServers(array($wgTitle->getInternalURL()));
+ $wgOut->setSquidMaxage( $wgSquidMaxage );
+ $wgArticle->view();
+ break;
default:
$wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
}
}
$wgOut->output();
+
foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }
logProfilingData();
wfDebug( "Request ended normally\n" );