From 0d2817bf9ec745295e6c56f93588290bedb957b6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 2 Jul 2014 00:10:13 +0000 Subject: [PATCH] Simplify a condition in get_sample_permalink_html(). see #28350. git-svn-id: https://develop.svn.wordpress.org/trunk@28948 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index b87269d64e..7f6bda4207 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1198,18 +1198,12 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { $return .= '' . __('Change Permalinks') . "\n"; } } else { - 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; - } + if ( function_exists( 'mb_strlen' ) && mb_strlen( $post_name ) > 30 ) { + $post_name_abridged = mb_substr( $post_name, 0, 14 ) . '…' . mb_substr( $post_name, -14 ); + } elseif ( strlen( $post_name ) > 30 ) { + $post_name_abridged = substr( $post_name, 0, 14 ) . '…' . substr( $post_name, -14 ); } else { - 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_abridged = $post_name; } $post_name_html = '' . $post_name_abridged . '';