Use mb_substr for trackback titles. Props zet. fixes #1474

git-svn-id: http://svn.automattic.com/wordpress/trunk@3107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-11-16 09:38:54 +00:00
parent 428f06c54a
commit 60006e43f2
1 changed files with 6 additions and 4 deletions

View File

@ -68,12 +68,14 @@ if ( !empty($tb_url) && !empty($title) && !empty($tb_url) ) {
trackback_response(1, 'Sorry, trackbacks are closed for this item.');
$title = wp_specialchars( strip_tags( $title ) );
$title = (strlen($title) > 250) ? substr($title, 0, 250) . '...' : $title;
$excerpt = strip_tags($excerpt);
if ( function_exists('mb_strcut') ) // For international trackbacks
$excerpt = mb_strcut($excerpt, 0, 252, get_settings('blog_charset')) . '...';
else
if ( function_exists('mb_substr') ) { // For international trackbacks
$excerpt = mb_substr($excerpt, 0, 252, get_settings('blog_charset')) . '...';
$title = mb_substr($title, 0, 250, get_settings('blog_charset')) . '...';
} else {
$excerpt = (strlen($excerpt) > 255) ? substr($excerpt, 0, 252) . '...' : $excerpt;
$title = (strlen($title) > 250) ? substr($title, 0, 250) . '...' : $title;
}
$comment_post_ID = $tb_id;
$comment_author = $blog_name;