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
This commit is contained in:
parent
b9fa351736
commit
4d7b989116
@ -569,7 +569,7 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
|
|||||||
$url = get_edit_post_link( $draft->ID );
|
$url = get_edit_post_link( $draft->ID );
|
||||||
$title = _draft_or_post_title( $draft->ID );
|
$title = _draft_or_post_title( $draft->ID );
|
||||||
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), 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>';
|
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), 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>';
|
||||||
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 .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '</p>';
|
$item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '</p>';
|
||||||
$list[] = $item;
|
$list[] = $item;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user