X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMediaWiki.php;h=1a75714fbc53247dc915220c47c3912e82cce69d;hb=e22efbce178309cb4dd537633b634bfc9e17d571;hp=7a6987e20f5e11286af8fdbce5d704b56819eb73;hpb=6cfb2e3d7a2b96d5041312fcec88248bb46573d7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 7a6987e20f..1a75714fbc 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -346,6 +346,10 @@ class MediaWiki { return false; } + if ( $this->config->get( 'MainPageIsDomainRoot' ) && $request->getRequestURL() === '/' ) { + return false; + } + if ( $title->isSpecialPage() ) { list( $name, $subpage ) = MediaWikiServices::getInstance()->getSpecialPageFactory()-> resolveAlias( $title->getDBkey() ); @@ -522,11 +526,15 @@ class MediaWiki { try { $this->main(); } catch ( ErrorPageError $e ) { + $out = $this->context->getOutput(); + // TODO: Should ErrorPageError::report accept a OutputPage parameter? + $e->report( ErrorPageError::STAGE_OUTPUT ); + // T64091: while exceptions are convenient to bubble up GUI errors, // they are not internal application faults. As with normal requests, this // should commit, print the output, do deferred updates, jobs, and profiling. $this->doPreOutputCommit(); - $e->report(); // display the GUI error + $out->output(); // display the GUI error } } catch ( Exception $e ) { $context = $this->context; @@ -745,7 +753,7 @@ class MediaWiki { 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).