WordPress.org

Make WordPress Core

Changeset 22306


Ignore:
Timestamp:
10/25/2012 09:09:42 PM (7 years ago)
Author:
nacin
Message:

Split by [\r\n\t ] rather than \s to avoid UTF-8 issues. props SergeyBiryukov. fixes #21625.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r22256 r22306  
    570570            $title = _draft_or_post_title( $draft->ID );
    571571            $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit &#8220;%s&#8221;' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
    572             if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
     572            if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
    573573                $item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '&hellip;' : '' ) . '</p>';
    574574            $list[] = $item;
Note: See TracChangeset for help on using the changeset viewer.