From: Aaron Schulz Date: Tue, 6 Mar 2012 19:38:17 +0000 (+0000) Subject: r110955: also truncate rc_comment for log entries. This adds the code in save() to... X-Git-Tag: 1.31.0-rc.0~24362 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=48b4c56b8f70b24a66689ebe4e0064b565f35e2a;p=lhc%2Fweb%2Fwiklou.git r110955: also truncate rc_comment for log entries. This adds the code in save() to proof RecentChange a bit against such problems. --- diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 73c5299b15..1ce47e1573 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -166,7 +166,7 @@ class RecentChange { * @param $noudp bool */ public function save( $noudp = false ) { - global $wgLocalInterwiki, $wgPutIPinRC; + global $wgLocalInterwiki, $wgPutIPinRC, $wgContLang; $dbw = wfGetDB( DB_MASTER ); if( !is_array($this->mExtra) ) { @@ -183,6 +183,9 @@ class RecentChange { unset( $this->mAttribs['rc_ip'] ); } + # Make sure summary is truncated (whole multibyte characters) + $this->mAttribs['rc_comment'] = $wgContLang->truncate( $this->mAttribs['rc_comment'], 255 ); + # Fixup database timestamps $this->mAttribs['rc_timestamp'] = $dbw->timestamp($this->mAttribs['rc_timestamp']); $this->mAttribs['rc_cur_time'] = $dbw->timestamp($this->mAttribs['rc_cur_time']);