Don't split in the middle of a UTF-8 character. Props nbachiyski. fixes #7254

git-svn-id: http://svn.automattic.com/wordpress/trunk@8264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-07-06 21:14:47 +00:00
parent ffc0077745
commit 0f48fa0124
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline {
function _splitOnWords($string, $newlineEscape = "\n") {
$string = str_replace("\0", '', $string);
$words = preg_split( '/([^\w])/', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
$words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
$words = str_replace( "\n", $newlineEscape, $words );
return $words;
}