From c7900e7c36bfaa9a402f611b7cb0444e6b53ff41 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 18 Jun 2005 09:34:25 +0000 Subject: [PATCH] Use Language::truncate() --- includes/Article.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ); -- 2.20.1