X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialBlock.php;h=23691b251a921878c0d11bfd6918ee987133f7c3;hb=a2c8c2969420a0f150c03f76e3a0bf9028fcda43;hp=42e7040d0e5638b5be7e8095caee879b9f2311ce;hpb=059fdf444ebc254fe703d36c98397164b5dbd533;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 42e7040d0e..23691b251a 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -135,6 +135,9 @@ class SpecialBlock extends FormSpecialPage { $suggestedDurations = self::getSuggestedDurations(); + $conf = $this->getConfig(); + $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD; + $a = [ 'Target' => [ 'type' => 'user', @@ -157,7 +160,11 @@ class SpecialBlock extends FormSpecialPage { ], 'Reason' => [ 'type' => 'selectandother', - 'maxlength' => 255, + // 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, + 'maxlength-unit' => 'codepoints', 'label-message' => 'ipbreason', 'options-message' => 'ipbreason-dropdown', ],