From 48b4c56b8f70b24a66689ebe4e0064b565f35e2a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 6 Mar 2012 19:38:17 +0000 Subject: [PATCH] r110955: also truncate rc_comment for log entries. This adds the code in save() to proof RecentChange a bit against such problems. --- includes/RecentChange.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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']); -- 2.20.1