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:
parent
ffc0077745
commit
0f48fa0124
|
@ -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