r110955: also truncate rc_comment for log entries. This adds the code in save() to...
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 6 Mar 2012 19:38:17 +0000 (19:38 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 6 Mar 2012 19:38:17 +0000 (19:38 +0000)
includes/RecentChange.php

index 73c5299..1ce47e1 100644 (file)
@@ -166,7 +166,7 @@ class RecentChange {
         * @param $noudp bool
         */
        public function save( $noudp = false ) {
-               global $wgLocalInterwiki, $wgPutIPinRC;
+               global $wgLocalInterwiki, $wgPutIPinRC, $wgContLang;
 
                $dbw = wfGetDB( DB_MASTER );
                if( !is_array($this->mExtra) ) {
@@ -183,6 +183,9 @@ class RecentChange {
                        unset( $this->mAttribs['rc_ip'] );
                }
 
+               # Make sure summary is truncated (whole multibyte characters)
+               $this->mAttribs['rc_comment'] = $wgContLang->truncate( $this->mAttribs['rc_comment'], 255 );
+
                # Fixup database timestamps
                $this->mAttribs['rc_timestamp'] = $dbw->timestamp($this->mAttribs['rc_timestamp']);
                $this->mAttribs['rc_cur_time'] = $dbw->timestamp($this->mAttribs['rc_cur_time']);