X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUndelete.php;h=540dbc6bf5016c5a51be65268b6f53f38d599912;hb=ea0f1b5f004a9dc1cdf5568259c337d45f15ce9b;hp=f821effdf0f53e853f92cca7e207d6a19fb6233b;hpb=47818f1b44a3525dff1c07778aaef65d06b8ae89;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index f821effdf0..540dbc6bf5 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -21,7 +21,7 @@ * @ingroup SpecialPage */ -use Wikimedia\Rdbms\ResultWrapper; +use Wikimedia\Rdbms\IResultWrapper; /** * Special page allowing users with the appropriate permissions to view @@ -306,7 +306,7 @@ class SpecialUndelete extends SpecialPage { /** * Generic list of deleted pages * - * @param ResultWrapper $result + * @param IResultWrapper $result * @return bool */ private function showList( $result ) { @@ -450,9 +450,7 @@ class SpecialUndelete extends SpecialPage { if ( ( $this->mPreview || !$isText ) && $content ) { // NOTE: non-text content has no source view, so always use rendered preview - // Hide [edit]s $popts = $out->parserOptions(); - $popts->setEditSection( false ); $pout = $content->getParserOutput( $this->mTargetObj, $rev->getId(), $popts, true ); $out->addParserOutput( $pout, [ @@ -741,6 +739,9 @@ 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', @@ -748,6 +749,10 @@ class SpecialUndelete extends SpecialPage { 'infusable' => true, 'value' => $this->mComment, '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, ] ), [ 'label' => $this->msg( 'undeletecomment' )->text(),