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

git-svn-id: https://develop.svn.wordpress.org/trunk@3107 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-11-16 09:38:54 +00:00
parent 5135115f45
commit 2bf017f58a
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;