X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;ds=sidebyside;f=includes%2Fspecials%2FSpecialEditTags.php;h=60d5fd7c8cb2d0a45a4ac60d0e4e105615780d24;hb=077d8f78139037e6f724ab24df8bde10b8708ce0;hp=962395367bd6482c5fd52b3ffb7dce146f5380d7;hpb=16ef3e79c4c52aa6b74563b7eadcfc9792e7a4c4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialEditTags.php b/includes/specials/SpecialEditTags.php index 962395367b..60d5fd7c8c 100644 --- a/includes/specials/SpecialEditTags.php +++ b/includes/specials/SpecialEditTags.php @@ -239,6 +239,9 @@ class SpecialEditTags extends UnlistedSpecialPage { // Show form if the user can submit if ( $this->isAllowed ) { + $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' ] ) . @@ -251,12 +254,14 @@ class SpecialEditTags extends UnlistedSpecialPage { Xml::label( $this->msg( 'tags-edit-reason' )->text(), 'wpReason' ) . '' . '' . - Xml::input( - 'wpReason', - 60, - $this->reason, - [ 'id' => 'wpReason', 'maxlength' => 100 ] - ) . + Xml::input( 'wpReason', 60, $this->reason, [ + '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 auto-generated part of the log entry. + 'maxlength' => $oldCommentSchema ? 100 : CommentStore::COMMENT_CHARACTER_LIMIT - 155, + ] ) . '' . "\n" . '' .