Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/149910

Change subject: Truncate block reason for whole multibyte characters
......................................................................

Truncate block reason for whole multibyte characters

This apply to Special:BlockList or to the block message shown to the
user, or api results. Log is not effected, because it already truncate
on its own.

Change-Id: I0a8bae5f43fd1604034d65e96c9461a9f83c0b0a
---
M includes/specials/SpecialBlock.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/149910/1

diff --git a/includes/specials/SpecialBlock.php 
b/includes/specials/SpecialBlock.php
index f8b2e8d..3297c17 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -600,7 +600,7 @@
         * @return bool|string
         */
        public static function processForm( array $data, IContextSource 
$context ) {
-               global $wgBlockAllowsUTEdit, $wgHideUserContribLimit;
+               global $wgBlockAllowsUTEdit, $wgHideUserContribLimit, 
$wgContLang;
 
                $performer = $context->getUser();
 
@@ -687,7 +687,8 @@
                $block = new Block();
                $block->setTarget( $target );
                $block->setBlocker( $performer );
-               $block->mReason = $data['Reason'][0];
+               # Truncate reason for whole multibyte characters
+               $block->mReason = $wgContLang->truncate( $data['Reason'][0], 
255 );
                $block->mExpiry = self::parseExpiryInput( $data['Expiry'] );
                $block->prevents( 'createaccount', $data['CreateAccount'] );
                $block->prevents( 'editownusertalk', ( !$wgBlockAllowsUTEdit || 
$data['DisableUTEdit'] ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/149910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a8bae5f43fd1604034d65e96c9461a9f83c0b0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to