From: Raimond Spekking Date: Fri, 12 Feb 2010 21:45:14 +0000 (+0000) Subject: * Truncate summary of page moves in revision comment field to avoid broken multibyte... X-Git-Tag: 1.31.0-rc.0~37796 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22calendrier%22%2C%22type=semaine%22%29%20.%20%22?a=commitdiff_plain;h=2c27120fccf707cb7cc99f3d2d04ebd8542a9741;p=lhc%2Fweb%2Fwiklou.git * Truncate summary of page moves in revision comment field to avoid broken multibyte characters Example: http://de.wikipedia.org/w/index.php?title=Benutzer_Diskussion:Meister_Eiskalt/Babel3&action=history --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c5ee8ca5b5..715105335a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -758,6 +758,8 @@ comment from another wiki. * (bug 8785) Pipe trick should work with colon functions * (bug 4099) Pipe trick doesn't work when emptiness is only provided by empty template parameter +* Truncate summary of page moves in revision comment field to avoid broken + multibyte characters == API changes in 1.16 == diff --git a/includes/Title.php b/includes/Title.php index 563bd9ea0d..8d7275ff0d 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2890,13 +2890,15 @@ class Title { * Ignored if the user doesn't have the suppressredirect right */ private function moveOverExistingRedirect( &$nt, $reason = '', $createRedirect = true ) { - global $wgUseSquid, $wgUser; + global $wgUseSquid, $wgUser, $wgContLang; $comment = wfMsgForContent( '1movedto2_redir', $this->getPrefixedText(), $nt->getPrefixedText() ); if ( $reason ) { $comment .= wfMsgForContent( 'colon-separator' ) . $reason; } + # Truncate for whole multibyte characters. +5 bytes for ellipsis + $comment = $wgContLang->truncate( $comment, 250 ); $now = wfTimestampNow(); $newid = $nt->getArticleID(); @@ -3004,7 +3006,7 @@ class Title { * Ignored if the user doesn't have the suppressredirect right */ private function moveToNewTitle( &$nt, $reason = '', $createRedirect = true ) { - global $wgUseSquid, $wgUser; + global $wgUseSquid, $wgUser, $wgContLang; $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ); if ( $reason ) { @@ -3012,6 +3014,8 @@ class Title { array( 'escapenoentities', 'content' ) ); $comment .= $reason; } + # Truncate for whole multibyte characters. +5 bytes for ellipsis + $comment = $wgContLang->truncate( $comment, 250 ); $newid = $nt->getArticleID(); $oldid = $this->getArticleID();