X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Factions%2FMcrUndoAction.php;h=41cd24e70125ebba6d66ab7ee6b1f3c674131b16;hp=b60820c0c37c6ef85cc332a8148dd7f8ab0510a7;hb=04d1aa3033f40a38d721f7f0e88b5bac440d2869;hpb=7ddab17aac1103fa080b50759ab6ca906caa554e diff --git a/includes/actions/McrUndoAction.php b/includes/actions/McrUndoAction.php index b60820c0c3..41cd24e701 100644 --- a/includes/actions/McrUndoAction.php +++ b/includes/actions/McrUndoAction.php @@ -30,7 +30,7 @@ class McrUndoAction extends FormAction { protected $undo = 0, $undoafter = 0, $cur = 0; - /** @param RevisionRecord|null */ + /** @var RevisionRecord|null */ protected $curRev = null; public function getName() { @@ -298,7 +298,7 @@ class McrUndoAction extends FormAction { 'class' => 'mw-content-' . $pageViewLang->getDir() ]; $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML ); - $out->addHtml( $previewhead . $previewHTML ); + $out->addHTML( $previewhead . $previewHTML ); } public function onSubmit( $data ) { @@ -336,8 +336,14 @@ class McrUndoAction extends FormAction { $updater->setOriginalRevisionId( false ); $updater->setUndidRevisionId( $this->undo ); + $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); + // TODO: Ugh. - if ( $wgUseRCPatrol && $this->getTitle()->userCan( 'autopatrol', $this->getUser() ) ) { + if ( $wgUseRCPatrol && $permissionManager->userCan( + 'autopatrol', + $this->getUser(), + $this->getTitle() ) + ) { $updater->setRcPatrolStatus( RecentChange::PRC_AUTOPATROLLED ); } @@ -358,8 +364,6 @@ class McrUndoAction extends FormAction { protected function getFormFields() { $request = $this->getRequest(); - $config = $this->context->getConfig(); - $oldCommentSchema = $config->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD; $ret = [ 'diff' => [ 'type' => 'info', @@ -375,7 +379,7 @@ class McrUndoAction extends FormAction { 'name' => 'wpSummary', 'cssclass' => 'mw-summary', 'label-message' => 'summary', - 'maxlength' => $oldCommentSchema ? 200 : CommentStore::COMMENT_CHARACTER_LIMIT, + 'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT, 'value' => $request->getVal( 'wpSummary', '' ), 'size' => 60, 'spellcheck' => 'true',