WordPress.org

Make WordPress Core

Ticket #8419: 8419-post.php.diff

File 8419-post.php.diff, 1.1 KB (added by janbrasna, 5 years ago)

Patch fixing #8419

  • post.php

    diff -urp svn/post.php dev/post.php
    svn dev function get_sample_permalink_html($id,  
    947947                return ''; 
    948948        } 
    949949        $title = __('Click to edit this part of the permalink'); 
    950         if (strlen($post_name) > 30) { 
    951                 $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); 
     950        if (function_exists('mb_strlen')) { 
     951                if (mb_strlen($post_name) > 30) { 
     952                        $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14); 
     953                } else { 
     954                        $post_name_abridged = $post_name; 
     955                } 
    952956        } else { 
    953                 $post_name_abridged = $post_name; 
     957                if (strlen($post_name) > 30) { 
     958                        $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); 
     959                } else { 
     960                        $post_name_abridged = $post_name; 
     961                } 
    954962        } 
    955963        $post_name_html = '<span id="editable-post-name" title="'.$title.'">'.$post_name_abridged.'</span><span id="editable-post-name-full">'.$post_name.'</span>'; 
    956964        $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);