) {
list( , $subpage ) = $spFactory->resolveAlias( $title->getDBkey() );
$target = $specialPage->getRedirect( $subpage );
- // target can also be true. We let that case fall through to normal processing.
+ // Target can also be true. We let that case fall through to normal processing.
if ( $target instanceof Title ) {
+ if ( $target->isExternal() ) {
+ // Handle interwiki redirects
+ $target = SpecialPage::getTitleFor(
+ 'GoToInterwiki',
+ 'force/' . $target->getPrefixedDBkey()
+ );
+ }
+
$query = $specialPage->getRedirectQuery( $subpage ) ?: [];
$request = new DerivativeRequest( $this->context->getRequest(), $query );
$request->setRequestURL( $this->context->getRequest()->getRequestURL() );
return false;
}
+ if ( $this->config->get( 'MainPageIsDomainRoot' ) && $request->getRequestURL() === '/' ) {
+ return false;
+ }
+
if ( $title->isSpecialPage() ) {
list( $name, $subpage ) = MediaWikiServices::getInstance()->getSpecialPageFactory()->
resolveAlias( $title->getDBkey() );
Profiler::instance()->logDataPageOutputOnly();
} catch ( Exception $e ) {
// An error may already have been shown in run(), so just log it to be safe
- MWExceptionHandler::rollbackMasterChangesAndLog( $e );
+ MWExceptionHandler::logException( $e );
}
// Disable WebResponse setters for post-send processing (T191537).