Merge "Recalculate user default options for each test"
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index cd754ca..529c331 100644 (file)
@@ -199,7 +199,7 @@ class SpecialUndelete extends SpecialPage {
                        } else {
                                $this->showFile( $this->mFilename );
                        }
-               } elseif ( $this->mAction === "submit" ) {
+               } elseif ( $this->mAction === 'submit' ) {
                        if ( $this->mRestore ) {
                                $this->undelete();
                        } elseif ( $this->mRevdel ) {
@@ -223,13 +223,14 @@ class SpecialUndelete extends SpecialPage {
                foreach ( $this->getRequest()->getValues() as $key => $val ) {
                        $matches = [];
                        if ( preg_match( "/^ts(\d{14})$/", $key, $matches ) ) {
-                               $revisions[ $archive->getRevision( $matches[1] )->getId() ] = 1;
+                               $revisions[$archive->getRevision( $matches[1] )->getId()] = 1;
                        }
                }
+
                $query = [
-                       "type" => "revision",
-                       "ids" => $revisions,
-                       "target" => $this->mTargetObj->getPrefixedText()
+                       'type' => 'revision',
+                       'ids' => $revisions,
+                       'target' => $this->mTargetObj->getPrefixedText()
                ];
                $url = SpecialPage::getTitleFor( 'Revisiondelete' )->getFullURL( $query );
                $this->getOutput()->redirect( $url );
@@ -493,7 +494,7 @@ class SpecialUndelete extends SpecialPage {
                                'readonly' => 'readonly',
                                'cols' => 80,
                                'rows' => 25
-                       ], $content->getNativeData() . "\n" );
+                       ], $content->getText() . "\n" );
 
                        $buttonFields[] = new OOUI\ButtonInputWidget( [
                                'type' => 'submit',
@@ -769,9 +770,6 @@ class SpecialUndelete extends SpecialPage {
                                'content' => new OOUI\HtmlSnippet( $this->msg( 'undeleteextrahelp' )->parseAsBlock() )
                        ] );
 
-                       $conf = $this->getConfig();
-                       $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
-
                        $fields[] = new OOUI\FieldLayout(
                                new OOUI\TextInputWidget( [
                                        'name' => 'wpComment',
@@ -781,8 +779,8 @@ class SpecialUndelete extends SpecialPage {
                                        'autofocus' => true,
                                        // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
                                        // (e.g. emojis) count for two each. This limit is overridden in JS to instead count
-                                       // Unicode codepoints (or 255 UTF-8 bytes for old schema).
-                                       'maxLength' => $oldCommentSchema ? 255 : CommentStore::COMMENT_CHARACTER_LIMIT,
+                                       // Unicode codepoints.
+                                       'maxLength' => CommentStore::COMMENT_CHARACTER_LIMIT,
                                ] ),
                                [
                                        'label' => $this->msg( 'undeletecomment' )->text(),