Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / actions / McrUndoAction.php
index 6309362..e9de846 100644 (file)
@@ -6,9 +6,9 @@
  */
 
 use MediaWiki\MediaWikiServices;
-use MediaWiki\Storage\MutableRevisionRecord;
-use MediaWiki\Storage\RevisionRecord;
-use MediaWiki\Storage\SlotRecord;
+use MediaWiki\Revision\MutableRevisionRecord;
+use MediaWiki\Revision\RevisionRecord;
+use MediaWiki\Revision\SlotRecord;
 
 /**
  * Temporary action for MCR undos
@@ -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() {
@@ -283,16 +283,22 @@ class McrUndoAction extends FormAction {
                        $previewHTML = '';
                }
 
-               $previewhead = "<div class='previewnote'>\n" .
-                       '<h2 id="mw-previewheader">' . $this->context->msg( 'preview' )->escaped() . "</h2>" .
-                       $out->parse( $note, true, /* interface */true ) . "<hr /></div>\n";
+               $previewhead = Html::rawElement(
+                       'div', [ 'class' => 'previewnote' ],
+                       Html::element(
+                               'h2', [ 'id' => 'mw-previewheader' ],
+                               $this->context->msg( 'preview' )->text()
+                       ) .
+                       $out->parseAsInterface( $note ) .
+                       "<hr />"
+               );
 
                $pageViewLang = $this->getTitle()->getPageViewLanguage();
                $attribs = [ 'lang' => $pageViewLang->getHtmlCode(), 'dir' => $pageViewLang->getDir(),
                        'class' => 'mw-content-' . $pageViewLang->getDir() ];
                $previewHTML = Html::rawElement( 'div', $attribs, $previewHTML );
 
-               $out->addHtml( $previewhead . $previewHTML );
+               $out->addHTML( $previewhead . $previewHTML );
        }
 
        public function onSubmit( $data ) {
@@ -352,8 +358,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',
@@ -369,7 +373,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',