+ if ( $content === false ) {
+ // Hack for restoring old revisions while EditPage
+ // can't handle multi-slot editing.
+
+ $curRevision = $this->page->getRevision();
+ $oldRevision = $this->mArticle->getRevisionFetched();
+
+ if ( $curRevision
+ && $oldRevision
+ && $curRevision->getId() !== $oldRevision->getId()
+ && ( WikiPage::hasDifferencesOutsideMainSlot( $oldRevision, $curRevision )
+ || !$this->isSupportedContentModel( $oldRevision->getContentModel() ) )
+ ) {
+ $this->context->getOutput()->redirect(
+ $this->mTitle->getFullURL(
+ [
+ 'action' => 'mcrrestore',
+ 'restore' => $oldRevision->getId(),
+ ]
+ )
+ );
+
+ return false;
+ }
+ }
+