From: addshore Date: Thu, 26 Jan 2017 18:30:28 +0000 (+0100) Subject: EditPage: Remove checks for false contentModel X-Git-Tag: 1.31.0-rc.0~3888^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=49aa4cf14c2c009e578342299516d3aacd17e42a;p=lhc%2Fweb%2Fwiklou.git EditPage: Remove checks for false contentModel contentModel should always have a value here. Change-Id: I38ab7211d63ec8b729965e8eefef4ed330f7b1f9 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index a02392e2eb..c22125a6a2 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -363,8 +363,8 @@ class EditPage { /** @var bool */ public $bot = true; - /** @var null|string */ - public $contentModel = null; + /** @var string */ + public $contentModel; /** @var null|string */ public $contentFormat = null; @@ -1255,11 +1255,7 @@ class EditPage { } $revision = $this->mArticle->getRevisionFetched(); if ( $revision === null ) { - if ( !$this->contentModel ) { - throw new RuntimeException( 'EditPage contentModel was false' ); - } $handler = ContentHandler::getForModelID( $this->contentModel ); - return $handler->makeEmptyContent(); } $content = $revision->getContent( Revision::FOR_THIS_USER, $user ); @@ -1299,11 +1295,7 @@ class EditPage { $content = $rev ? $rev->getContent( Revision::RAW ) : null; if ( $content === false || $content === null ) { - if ( !$this->contentModel ) { - throw new RuntimeException( 'EditPage contentModel was false' ); - } $handler = ContentHandler::getForModelID( $this->contentModel ); - return $handler->makeEmptyContent(); } elseif ( !$this->undidRev ) { // Content models should always be the same since we error