r95456 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95455‎ | r95456 | r95457 >
Date:23:47, 24 August 2011
Author:bawolff
Status:ok
Tags:
Comment:
(bug 28649) use $wgContLang->truncate on log action comments to avoid half eaten unicode chars and also adds a nice '...'

Patch by Umherirrender.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -70,6 +70,8 @@
7171 warnings/notices to be thrown.
7272 * (bug 30335) Fix for HTMLForms using GET breaking when non-friendly URLs are
7373 used
 74+* (bug 28649) Avoiding half truncated multi-byte unicode characters when
 75+ truncating log comments.
7476
7577 === API changes in 1.19 ===
7678 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/includes/LogPage.php
@@ -416,6 +416,8 @@
417417 * @param $doer User object: the user doing the action
418418 */
419419 public function addEntry( $action, $target, $comment, $params = array(), $doer = null ) {
 420+ global $wgContLang;
 421+
420422 if ( !is_array( $params ) ) {
421423 $params = array( $params );
422424 }
@@ -424,6 +426,9 @@
425427 $comment = '';
426428 }
427429
 430+ # Truncate for whole multibyte characters.
 431+ $comment = $wgContLang->truncate( $comment, 255 );
 432+
428433 $this->action = $action;
429434 $this->target = $target;
430435 $this->comment = $comment;

Status & tagging log