X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialMovepage.php;h=d30ff4329de63a30f20587fb33f17da0cde24b4c;hb=ccc1c08089b6596bc20f6d88db1909f57fab2498;hp=02d6d0023252da49d29d657def5cab15292cecf3;hpb=d6b41380f7a71a0d8115bb45ef700c216322a4ce;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 02d6d00232..d30ff4329d 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -287,8 +287,8 @@ class MovePageForm extends UnlistedSpecialPage { $out->addHTML( "\n" ); } - // Byte limit (not string length limit) for wpReason and wpNewTitleMain - // is enforced in the mediawiki.special.movePage module + // Length limit for wpReason and wpNewTitleMain is enforced in the + // mediawiki.special.movePage module $immovableNamespaces = []; foreach ( array_keys( $this->getLanguage()->getNamespaces() ) as $nsId ) { @@ -326,11 +326,16 @@ class MovePageForm extends UnlistedSpecialPage { ] ); + // 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). + $conf = $this->getConfig(); + $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD; $fields[] = new OOUI\FieldLayout( new OOUI\TextInputWidget( [ 'name' => 'wpReason', 'id' => 'wpReason', - 'maxLength' => 200, + 'maxLength' => $oldCommentSchema ? 200 : CommentStore::COMMENT_CHARACTER_LIMIT, 'infusable' => true, 'value' => $this->reason, ] ),