global $wgLogRestrictions;
$dbw = wfGetDB( DB_MASTER );
- $log_id = $dbw->nextSequenceValue( 'logging_log_id_seq' );
// @todo FIXME private/protected/public property?
$this->timestamp = $now = wfTimestampNow();
$data = [
- 'log_id' => $log_id,
'log_type' => $this->type,
'log_action' => $this->action,
'log_timestamp' => $dbw->timestamp( $now ),
* @return int The log_id of the inserted log entry
*/
public function addEntry( $action, $target, $comment, $params = [], $doer = null ) {
- global $wgContLang;
-
if ( !is_array( $params ) ) {
$params = [ $params ];
}
# Trim spaces on user supplied text
$comment = trim( $comment );
- # Truncate for whole multibyte characters.
- $comment = $wgContLang->truncate( $comment, 255 );
-
$this->action = $action;
$this->target = $target;
$this->comment = $comment;