private $config;
/**
- * @var String Cache what action this request is
+ * @var string Cache what action this request is
*/
private $action;
}
throw new HttpError( 500, $message );
}
- // Protect against redirects to NS_MEDIA namespace
- // when the user probably wants NS_FILE
- if ( $title->inNamespace( NS_MEDIA ) ) {
- $title->mNamespace = NS_FILE;
- }
$output->setCdnMaxage( 1200 );
$output->redirect( $targetUrl, '301' );
return true;
$action->show();
return;
}
- // NOTE: deprecated hook. Add to $wgActions instead
- if ( Hooks::run(
- 'UnknownAction',
- [
- $request->getVal( 'action', 'view' ),
- $page
- ],
- '1.19'
- ) ) {
- $output->setStatusCode( 404 );
- $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
- }
+
+ // If we've not found out which action it is by now, it's unknown
+ $output->setStatusCode( 404 );
+ $output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
}
/**
*/
private static function getUrlDomainDistance( $url ) {
$clusterWiki = WikiMap::getWikiFromUrl( $url );
- if ( $clusterWiki === wfWikiID() ) {
+ if ( WikiMap::isCurrentWikiId( $clusterWiki ) ) {
return 'local'; // the current wiki
- } elseif ( $clusterWiki !== false ) {
+ }
+ if ( $clusterWiki !== false ) {
return 'remote'; // another wiki in this cluster/farm
}
* @since 1.26
*/
public function doPostOutputShutdown( $mode = 'normal' ) {
+ // Record backend request timing
+ $timing = $this->context->getTiming();
+ $timing->mark( 'requestShutdown' );
+
// Perform the last synchronous operations...
try {
- // Record backend request timing
- $timing = $this->context->getTiming();
- $timing->mark( 'requestShutdown' );
// Show visible profiling data if enabled (which cannot be post-send)
Profiler::instance()->logDataPageOutputOnly();
} catch ( Exception $e ) {
__METHOD__
);
- // Important: this must be the last deferred update added (T100085, T154425)
- DeferredUpdates::addCallableUpdate( [ JobQueueGroup::class, 'pushLazyJobs' ] );
-
// Do any deferred jobs; preferring to run them now if a client will not wait on them
DeferredUpdates::doUpdates( $blocksHttpClient ? 'enqueue' : 'run' );