X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flogging%2FLogPage.php;h=77d9aa21baa687d320285344eaa2847d0b6c585c;hb=16ef3e79c4c52aa6b74563b7eadcfc9792e7a4c4;hp=a085e3e114b2a0a6ed0d1bb1c6957ae933016596;hpb=9404f8a589a9eed548da33fbfbcb12d3038e59e0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogPage.php b/includes/logging/LogPage.php index a085e3e114..77d9aa21ba 100644 --- a/includes/logging/LogPage.php +++ b/includes/logging/LogPage.php @@ -90,12 +90,10 @@ class LogPage { 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 ), @@ -104,9 +102,9 @@ class LogPage { 'log_namespace' => $this->target->getNamespace(), 'log_title' => $this->target->getDBkey(), 'log_page' => $this->target->getArticleID(), - 'log_comment' => $this->comment, 'log_params' => $this->params ]; + $data += CommentStore::newKey( 'log_comment' )->insert( $dbw, $this->comment ); $dbw->insert( 'logging', $data, __METHOD__ ); $newId = $dbw->insertId(); @@ -321,7 +319,7 @@ class LogPage { * * @param string $action One of '', 'block', 'protect', 'rights', 'delete', * 'upload', 'move', 'move_redir' - * @param Title $target Title object + * @param Title $target * @param string $comment Description associated * @param array $params Parameters passed later to wfMessage function * @param null|int|User $doer The user doing the action. null for $wgUser @@ -329,8 +327,6 @@ class LogPage { * @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 ]; } @@ -342,9 +338,6 @@ class LogPage { # 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;