From 4d7b9891160d90ddccd0b585ebb162407b8f79c9 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 25 Oct 2012 21:09:42 +0000 Subject: [PATCH] Split by [\r\n\t ] rather than \s to avoid UTF-8 issues. props SergeyBiryukov. fixes #21625. git-svn-id: https://develop.svn.wordpress.org/trunk@22306 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index d44b298e01..a67a2a5cc0 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -569,7 +569,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) { $url = get_edit_post_link( $draft->ID ); $title = _draft_or_post_title( $draft->ID ); $item = "

" . esc_html($title) . " " . get_the_time( get_option( 'date_format' ), $draft ) . '

'; - if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) ) + if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) ) $item .= '

' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '

'; $list[] = $item; }