Multi-byte character safe excerpting from nbachiyski. fixes #6077

git-svn-id: http://svn.automattic.com/wordpress/trunk@7140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2008-03-03 21:05:23 +00:00
parent b1f0a853da
commit 6e181bb941
6 changed files with 56 additions and 19 deletions

View File

@@ -1046,11 +1046,7 @@ function do_trackbacks($post_id) {
else
$excerpt = apply_filters('the_excerpt', $post->post_excerpt);
$excerpt = str_replace(']]>', ']]>', $excerpt);
$excerpt = strip_tags($excerpt);
if ( function_exists('mb_strcut') ) // For international trackbacks
$excerpt = mb_strcut($excerpt, 0, 252, get_option('blog_charset')) . '...';
else
$excerpt = substr($excerpt, 0, 252) . '...';
$excerpt = wp_html_excerpt($excerpt, 252) . '...';
$post_title = apply_filters('the_title', $post->post_title);
$post_title = strip_tags($post_title);