Merge "Move around "ا" to after "آ" and not before"
[lhc/web/wiklou.git] / includes / logging / LogPage.php
index ec97b50..e421209 100644 (file)
@@ -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();
 
@@ -287,7 +285,7 @@ class LogPage {
         * @param string $type
         * @param Language|null $lang
         * @param Title $title
-        * @param array $params
+        * @param array &$params
         * @return string
         */
        protected static function getTitleLink( $type, $lang, $title, &$params ) {
@@ -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;