X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Fchanges%2FRecentChange.php;h=199222307c36c08022ac2bd18c4a50393294c7b1;hb=a17d459d4bfa29f56181f0be1e407336574d9361;hp=588f602e64864ba7dadbc5dc86fe92427ac205e5;hpb=11cf01dd9a8512ad4d9bded43cf22ebd38af8818;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 588f602e64..199222307c 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -284,7 +284,7 @@ class RecentChange { * @param bool $noudp */ public function save( $noudp = false ) { - global $wgPutIPinRC, $wgUseEnotif, $wgShowUpdatedMarker, $wgContLang; + global $wgPutIPinRC, $wgUseEnotif, $wgShowUpdatedMarker; $dbw = wfGetDB( DB_MASTER ); if ( !is_array( $this->mExtra ) ) { @@ -315,12 +315,8 @@ class RecentChange { # Trim spaces on user supplied text $this->mAttribs['rc_comment'] = trim( $this->mAttribs['rc_comment'] ); - # 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_id'] = $dbw->nextSequenceValue( 'recentchanges_rc_id_seq' ); # # If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL if ( $this->mAttribs['rc_cur_id'] == 0 ) { @@ -333,6 +329,10 @@ class RecentChange { unset( $row['rc_comment'], $row['rc_comment_text'], $row['rc_comment_data'] ); $row += CommentStore::newKey( 'rc_comment' )->insert( $dbw, $comment ); + # Don't reuse an existing rc_id for the new row, if one happens to be + # set for some reason. + unset( $row['rc_id'] ); + # Insert new row $dbw->insert( 'recentchanges', $row, __METHOD__ );