X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=7a5832609c0114348baf5b1a42f34c6a25b5c3e3;hb=8c0b8ebb589f02570009f4c0009add34a0ae513e;hp=e562bea3bac3b624ba39620b6fda32ef008a7dda;hpb=ee553f8e32a8f1bd8c0232dbbf1127e3592d29b2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index e562bea3ba..7a5832609c 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 @@ -2326,12 +2318,9 @@ class EditPage { } public function setHeaders() { - global $wgOut, $wgUser, $wgAjaxEditStash, $wgCookieSetOnAutoblock; + global $wgOut, $wgUser, $wgAjaxEditStash; $wgOut->addModules( 'mediawiki.action.edit' ); - if ( $wgCookieSetOnAutoblock === true ) { - $wgOut->addModules( 'mediawiki.user.blockcookie' ); - } $wgOut->addModuleStyles( 'mediawiki.action.edit.styles' ); if ( $wgUser->getOption( 'showtoolbar' ) ) { @@ -2618,7 +2607,7 @@ class EditPage { return; } - $this->showHeader(); + $this->showHeader(); $wgOut->addHTML( $this->editFormPageTop ); @@ -3565,7 +3554,7 @@ HTML } } - private function incrementConflictStats() { + protected function incrementConflictStats() { $stats = MediaWikiServices::getInstance()->getStatsdDataFactory(); $stats->increment( 'edit.failures.conflict' ); // Only include 'standard' namespaces to avoid creating unknown numbers of statsd metrics