Handle comment truncation in CommentStore
[lhc/web/wiklou.git] / includes / logging / LogPage.php
index a085e3e..53ef828 100644 (file)
@@ -104,9 +104,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();
 
@@ -329,8 +329,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 +340,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;