Index: trunk/phase3/includes/logging/LogEntry.php |
— | — | @@ -410,6 +410,8 @@ |
411 | 411 | * @return int If of the log entry |
412 | 412 | */ |
413 | 413 | public function insert() { |
| 414 | + global $wgContLang; |
| 415 | + |
414 | 416 | $dbw = wfGetDB( DB_MASTER ); |
415 | 417 | $id = $dbw->nextSequenceValue( 'logging_log_id_seq' ); |
416 | 418 | |
— | — | @@ -417,6 +419,9 @@ |
418 | 420 | $this->timestamp = wfTimestampNow(); |
419 | 421 | } |
420 | 422 | |
| 423 | + # Truncate for whole multibyte characters. |
| 424 | + $comment = $wgContLang->truncate( $this->getComment(), 255 ); |
| 425 | + |
421 | 426 | $data = array( |
422 | 427 | 'log_id' => $id, |
423 | 428 | 'log_type' => $this->getType(), |
— | — | @@ -427,7 +432,7 @@ |
428 | 433 | 'log_namespace' => $this->getTarget()->getNamespace(), |
429 | 434 | 'log_title' => $this->getTarget()->getDBkey(), |
430 | 435 | 'log_page' => $this->getTarget()->getArticleId(), |
431 | | - 'log_comment' => $this->getComment(), |
| 436 | + 'log_comment' => $comment, |
432 | 437 | 'log_params' => serialize( (array) $this->getParameters() ), |
433 | 438 | ); |
434 | 439 | $dbw->insert( 'logging', $data, __METHOD__ ); |