WordPress.org

Make WordPress Core

Ticket #11244: 11244-double-hellip.3.diff

File 11244-double-hellip.3.diff, 833 bytes (added by nacin, 5 years ago)

Noticed that patch 2 was missing a space before the […]. This one adds it.

  • wp-includes/default-widgets.php

     
    803803                if ( empty($title) ) 
    804804                        $title = __('Untitled'); 
    805805 
    806                 $desc = str_replace(array("\n", "\r"), ' ', esc_attr(strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))))); 
    807                 $desc = wp_html_excerpt( $desc, 360 ) . ' […]'; 
     806                $raw_desc = str_replace(array("\n", "\r"), ' ', esc_attr(strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))))); 
     807                $desc = wp_html_excerpt( $raw_desc, 360 ); 
     808                $desc .= ( mb_strlen( $raw_desc ) > 360 ) ? ' […]' : ''; 
    808809                $desc = esc_html( $desc ); 
    809810 
    810811                if ( $show_summary ) {