X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRevisiondelete.php;h=e7db9f5e3cfd29a6c3cde343f91640ba9b458575;hb=96998d51f9788b0397c93b00a4ebfcfd4ed85c54;hp=aec21dc4d3c3b04b090dfcfdd1b0549bcfaa7498;hpb=fe4b09380562976aea9f06e59d342fff8d91b026;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index aec21dc4d3..e7db9f5e3c 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -418,8 +418,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { // Show form if the user can submit if ( $this->mIsAllowed ) { + $out->addModules( [ 'mediawiki.special.revisionDelete' ] ); $out->addModuleStyles( 'mediawiki.special' ); + $conf = $this->getConfig(); + $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD; + $form = Xml::openElement( 'form', [ 'method' => 'post', 'action' => $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] ), 'id' => 'mw-revdel-form-revisions' ] ) . @@ -442,12 +446,14 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { Xml::label( $this->msg( 'revdelete-otherreason' )->text(), 'wpReason' ) . '' . '' . - Xml::input( - 'wpReason', - 60, - $this->otherReason, - [ 'id' => 'wpReason', 'maxlength' => 100 ] - ) . + Xml::input( 'wpReason', 60, $this->otherReason, [ + 'id' => 'wpReason', + // 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). + // "- 155" is to leave room for the 'wpRevDeleteReasonList' value. + 'maxlength' => $oldCommentSchema ? 100 : CommentStore::COMMENT_CHARACTER_LIMIT - 155, + ] ) . '' . "\n" . '' .