Check for [\r\n\t ] instead of \s in get_content_chat() to avoid UTF-8 issues. see #23625.

git-svn-id: http://core.svn.wordpress.org/trunk@23914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-04-04 23:43:59 +00:00
parent 2d4b834a16
commit f7e2bb59d6
1 changed files with 2 additions and 2 deletions

View File

@ -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(