r113171 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113170‎ | r113171 | r113172 >
Date:19:38, 6 March 2012
Author:aaron
Status:ok
Tags:
Comment:
r110955: also truncate rc_comment for log entries. This adds the code in save() to proof RecentChange a bit against such problems.
Modified paths:
  • /trunk/phase3/includes/RecentChange.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RecentChange.php
@@ -166,7 +166,7 @@
167167 * @param $noudp bool
168168 */
169169 public function save( $noudp = false ) {
170 - global $wgLocalInterwiki, $wgPutIPinRC;
 170+ global $wgLocalInterwiki, $wgPutIPinRC, $wgContLang;
171171
172172 $dbw = wfGetDB( DB_MASTER );
173173 if( !is_array($this->mExtra) ) {
@@ -183,6 +183,9 @@
184184 unset( $this->mAttribs['rc_ip'] );
185185 }
186186
 187+ # Make sure summary is truncated (whole multibyte characters)
 188+ $this->mAttribs['rc_comment'] = $wgContLang->truncate( $this->mAttribs['rc_comment'], 255 );
 189+
187190 # Fixup database timestamps
188191 $this->mAttribs['rc_timestamp'] = $dbw->timestamp($this->mAttribs['rc_timestamp']);
189192 $this->mAttribs['rc_cur_time'] = $dbw->timestamp($this->mAttribs['rc_cur_time']);

Follow-up revisions

RevisionCommit summaryAuthorDate
r113235MFT r113171, r113195, r113211reedy15:14, 7 March 2012
r113938MFT r113171reedy17:40, 15 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110955(bug 33374) - 'Deletion log summary not properly truncated'aaron19:53, 8 February 2012

Status & tagging log