From: Brion Vibber Date: Sat, 18 Jun 2005 09:34:25 +0000 (+0000) Subject: Use Language::truncate() X-Git-Tag: 1.5.0beta1~164 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=c7900e7c36bfaa9a402f611b7cb0444e6b53ff41;p=lhc%2Fweb%2Fwiklou.git Use Language::truncate() --- diff --git a/includes/Article.php b/includes/Article.php index 9e94b43663..25dfbfb310 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1635,15 +1635,15 @@ class Article { # comment field=255, let's grep the first 150 to have some user # space left - $text=mb_substr($text,0,150); + global $wgContLang; + $text = $wgContLang->truncate( $text, 150, '...' ); + # let's strip out newlines and HTML tags $text=preg_replace('/\"/',"'",$text); $text=preg_replace('/\/','>',$text); $text=preg_replace("/[\n\r]/",'',$text); - if( $length > 150 ) { $text .= '...'; } # we've only pasted part of the text - if(!$blanked) { if(!$all_same_user) { $reason = wfMsg ( 'excontent', $text );