From 0f48fa01241cad774b9d713cfefacfeb91184e2d Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 6 Jul 2008 21:14:47 +0000 Subject: [PATCH] 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 --- wp-includes/wp-diff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/wp-diff.php b/wp-includes/wp-diff.php index f60614ad8..77f325812 100644 --- a/wp-includes/wp-diff.php +++ b/wp-includes/wp-diff.php @@ -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; }