Changeset 8264

Show
Ignore:
Timestamp:
07/06/08 21:14:47 (3 months ago)
Author:
ryan
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/wp-diff.php

    r7747 r8264  
    309309    function _splitOnWords($string, $newlineEscape = "\n") { 
    310310        $string = str_replace("\0", '', $string); 
    311         $words  = preg_split( '/([^\w])/', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); 
     311        $words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); 
    312312        $words  = str_replace( "\n", $newlineEscape, $words ); 
    313313        return $words;