From d942a526febef7482b109c8dca057f08ac0242f5 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 30 Nov 2008 19:09:13 +0000 Subject: [PATCH] Use mb_* to create permalink excerpt. Props janbrasna. fixes #8419 git-svn-id: https://develop.svn.wordpress.org/trunk@9986 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/post.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 42f4741ff0..c4d6a599a7 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -947,10 +947,18 @@ function get_sample_permalink_html($id, $new_title=null, $new_slug=null) { return ''; } $title = __('Click to edit this part of the permalink'); - if (strlen($post_name) > 30) { - $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); + if (function_exists('mb_strlen')) { + if (mb_strlen($post_name) > 30) { + $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14); + } else { + $post_name_abridged = $post_name; + } } else { - $post_name_abridged = $post_name; + if (strlen($post_name) > 30) { + $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); + } else { + $post_name_abridged = $post_name; + } } $post_name_html = ''.$post_name_abridged.''.$post_name.''; $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);