(bug 28649) use $wgContLang->truncate on log action comments to avoid half eaten unicode chars and also adds a nice '...'

Patch by Umherirrender.
This commit is contained in:
Brian Wolff 2011-08-24 23:47:54 +00:00
parent 119c570e28
commit 6857bb3df6
2 changed files with 7 additions and 0 deletions

View file

@ -70,6 +70,8 @@ production.
warnings/notices to be thrown.
* (bug 30335) Fix for HTMLForms using GET breaking when non-friendly URLs are
used
* (bug 28649) Avoiding half truncated multi-byte unicode characters when
truncating log comments.
=== API changes in 1.19 ===
* (bug 19838) siprop=interwikimap can now use the interwiki cache.

View file

@ -416,6 +416,8 @@ class LogPage {
* @param $doer User object: the user doing the action
*/
public function addEntry( $action, $target, $comment, $params = array(), $doer = null ) {
global $wgContLang;
if ( !is_array( $params ) ) {
$params = array( $params );
}
@ -424,6 +426,9 @@ class LogPage {
$comment = '';
}
# Truncate for whole multibyte characters.
$comment = $wgContLang->truncate( $comment, 255 );
$this->action = $action;
$this->target = $target;
$this->comment = $comment;