From: Aaron Schulz Date: Wed, 8 Feb 2012 19:53:55 +0000 (+0000) Subject: (bug 33374) - 'Deletion log summary not properly truncated' X-Git-Tag: 1.31.0-rc.0~24857 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=44da49558172b5d639a14a35ff0fa95a7d979140;p=lhc%2Fweb%2Fwiklou.git (bug 33374) - 'Deletion log summary not properly truncated' --- diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index 6fe7539d99..c6f717b4e4 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -410,6 +410,8 @@ class ManualLogEntry extends LogEntryBase { * @return int If of the log entry */ public function insert() { + global $wgContLang; + $dbw = wfGetDB( DB_MASTER ); $id = $dbw->nextSequenceValue( 'logging_log_id_seq' ); @@ -417,6 +419,9 @@ class ManualLogEntry extends LogEntryBase { $this->timestamp = wfTimestampNow(); } + # Truncate for whole multibyte characters. + $comment = $wgContLang->truncate( $this->getComment(), 255 ); + $data = array( 'log_id' => $id, 'log_type' => $this->getType(), @@ -427,7 +432,7 @@ class ManualLogEntry extends LogEntryBase { 'log_namespace' => $this->getTarget()->getNamespace(), 'log_title' => $this->getTarget()->getDBkey(), 'log_page' => $this->getTarget()->getArticleId(), - 'log_comment' => $this->getComment(), + 'log_comment' => $comment, 'log_params' => serialize( (array) $this->getParameters() ), ); $dbw->insert( 'logging', $data, __METHOD__ );