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:
parent
57532d83dd
commit
3cbb31b495
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user