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

git-svn-id: https://develop.svn.wordpress.org/trunk@8264 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-07-06 21:14:47 +00:00
parent 57532d83dd
commit 3cbb31b495
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;
}