jenkins-bot has submitted this change and it was merged.
Change subject: Truncate block reason for whole multibyte characters
......................................................................
Truncate block reason for whole multibyte characters
This applies to Special:BlockList, or to the block message shown to the
user, or API results. Log is not effected, because it already truncates
on its own.
Change-Id: I0a8bae5f43fd1604034d65e96c9461a9f83c0b0a
---
M includes/specials/SpecialBlock.php
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Siebrand: Looks good to me, approved
jenkins-bot: Verified
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: merged
Gerrit-Change-Id: I0a8bae5f43fd1604034d65e96c9461a9f83c0b0a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Happy-melon <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Raimond Spekking <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits