r110955 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110954‎ | r110955 | r110956 >
Date:19:53, 8 February 2012
Author:aaron
Status:ok (Comments)
Tags:
Comment:
(bug 33374) - 'Deletion log summary not properly truncated'
Modified paths:
  • /trunk/phase3/includes/logging/LogEntry.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/logging/LogEntry.php
@@ -410,6 +410,8 @@
411411 * @return int If of the log entry
412412 */
413413 public function insert() {
 414+ global $wgContLang;
 415+
414416 $dbw = wfGetDB( DB_MASTER );
415417 $id = $dbw->nextSequenceValue( 'logging_log_id_seq' );
416418
@@ -417,6 +419,9 @@
418420 $this->timestamp = wfTimestampNow();
419421 }
420422
 423+ # Truncate for whole multibyte characters.
 424+ $comment = $wgContLang->truncate( $this->getComment(), 255 );
 425+
421426 $data = array(
422427 'log_id' => $id,
423428 'log_type' => $this->getType(),
@@ -427,7 +432,7 @@
428433 'log_namespace' => $this->getTarget()->getNamespace(),
429434 'log_title' => $this->getTarget()->getDBkey(),
430435 'log_page' => $this->getTarget()->getArticleId(),
431 - 'log_comment' => $this->getComment(),
 436+ 'log_comment' => $comment,
432437 'log_params' => serialize( (array) $this->getParameters() ),
433438 );
434439 $dbw->insert( 'logging', $data, __METHOD__ );

Follow-up revisions

RevisionCommit summaryAuthorDate
r113171r110955: also truncate rc_comment for log entries. This adds the code in save...aaron19:38, 6 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96441Committing my new logging classes for review. Will later commit changes that ...nikerabbit15:32, 7 September 2011

Comments

#Comment by Umherirrender (talk | contribs)   14:28, 11 February 2012

Now the log looks good, but the log entry in the recentchanges is not truncated, see rev:96441#c30457.

#Comment by Aaron Schulz (talk | contribs)   21:21, 5 March 2012

Why is *this* revision tagged fixme?

#Comment by Umherirrender (talk | contribs)   19:24, 6 March 2012

Because getting no response of a comment about a error, which is near to the scope of this error, is bad. Okay, when this is not the right way to tell you that. It was also noted at the other revision which was linked in the bug.

Status & tagging log