X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FLogEntry.php;h=16b3593dd2fe490499568fe366af79b88d8fcd6e;hb=8fd5a99f4e261d37cd7237a1992b1bcf03a764d3;hp=6587304ffb3f969007c9c4b443963f7474a73296;hpb=802c199d0bd80ff0f4d730c61fd58cbf08a52d8d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogEntry.php b/includes/logging/LogEntry.php index 6587304ffb..16b3593dd2 100644 --- a/includes/logging/LogEntry.php +++ b/includes/logging/LogEntry.php @@ -170,7 +170,7 @@ class DatabaseLogEntry extends LogEntryBase { * @return array */ public static function getSelectQueryData() { - $commentQuery = CommentStore::newKey( 'log_comment' )->getJoin(); + $commentQuery = CommentStore::getStore()->getJoin( 'log_comment' ); $tables = [ 'logging', 'user' ] + $commentQuery['tables']; $fields = [ @@ -324,7 +324,7 @@ class DatabaseLogEntry extends LogEntryBase { } public function getComment() { - return CommentStore::newKey( 'log_comment' )->getComment( $this->row )->text; + return CommentStore::getStore()->getComment( 'log_comment', $this->row )->text; } public function getDeleted() { @@ -382,9 +382,9 @@ class RCDatabaseLogEntry extends DatabaseLogEntry { } public function getComment() { - return CommentStore::newKey( 'rc_comment' ) - // Legacy because the row probably used RecentChange::selectFields() - ->getCommentLegacy( wfGetDB( DB_REPLICA ), $this->row )->text; + return CommentStore::getStore() + // Legacy because the row may have used RecentChange::selectFields() + ->getCommentLegacy( wfGetDB( DB_REPLICA ), 'rc_comment', $this->row )->text; } public function getDeleted() { @@ -593,10 +593,7 @@ class ManualLogEntry extends LogEntryBase { * @throws MWException */ public function insert( IDatabase $dbw = null ) { - global $wgContLang; - $dbw = $dbw ?: wfGetDB( DB_MASTER ); - $id = $dbw->nextSequenceValue( 'logging_log_id_seq' ); if ( $this->timestamp === null ) { $this->timestamp = wfTimestampNow(); @@ -605,9 +602,6 @@ class ManualLogEntry extends LogEntryBase { // Trim spaces on user supplied text $comment = trim( $this->getComment() ); - // Truncate for whole multibyte characters. - $comment = $wgContLang->truncate( $comment, 255 ); - $params = $this->getParameters(); $relations = $this->relations; @@ -619,7 +613,6 @@ class ManualLogEntry extends LogEntryBase { } $data = [ - 'log_id' => $id, 'log_type' => $this->getType(), 'log_action' => $this->getSubtype(), 'log_timestamp' => $dbw->timestamp( $this->getTimestamp() ), @@ -633,7 +626,7 @@ class ManualLogEntry extends LogEntryBase { if ( isset( $this->deleted ) ) { $data['log_deleted'] = $this->deleted; } - $data += CommentStore::newKey( 'log_comment' )->insert( $dbw, $comment ); + $data += CommentStore::getStore()->insert( $dbw, 'log_comment', $comment ); $dbw->insert( 'logging', $data, __METHOD__ ); $this->id = $dbw->insertId();