From 576b34af425eceeb76c73553c653e85c259207fb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 4 Apr 2013 23:43:59 +0000 Subject: [PATCH] Check for [\r\n\t ] instead of \s in get_content_chat() to avoid UTF-8 issues. see #23625. git-svn-id: https://develop.svn.wordpress.org/trunk@23914 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-formats.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index 0fc45ea31d..fb67cfc674 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -528,9 +528,9 @@ function get_content_chat( &$content, $remove = false ) { $matched = preg_match( $newline_regex, $line, $matches ); $author_match = empty( $matches[2] ) ? $matches[1] : $matches[2]; // assume username syntax if no whitespace is present - $no_ws = $matched && ! preg_match( '#\s#', $author_match ); + $no_ws = $matched && ! preg_match( '#[\r\n\t ]#', $author_match ); // allow script-like stanzas - $has_ws = $matched && preg_match( '#\s#', $author_match ) && empty( $lines[$index + 1] ) && empty( $lines[$index - 1] ); + $has_ws = $matched && preg_match( '#[\r\n\t ]#', $author_match ) && empty( $lines[$index + 1] ) && empty( $lines[$index - 1] ); if ( $matched && ( ! empty( $matches[2] ) || ( $no_ws || $has_ws ) ) ) { if ( ! empty( $author ) ) { $stanza[] = array(