~canonical-sysadmins/wordpress/5.1.1

« back to all changes in this revision

Viewing changes to wp-includes/class-wp-text-diff-renderer-inline.php

  • Committer: Barry Price
  • Date: 2019-02-22 03:51:26 UTC
  • mfrom: (1.2.12 upstream)
  • Revision ID: barry.price@canonical.com-20190222035126-o28k38qs8jfyjsxt
Merge WP5.1 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
         * @param string $newlineEscape
24
24
         * @return string
25
25
         */
26
 
        public function _splitOnWords($string, $newlineEscape = "\n") {
27
 
                $string = str_replace("\0", '', $string);
 
26
        public function _splitOnWords( $string, $newlineEscape = "\n" ) {
 
27
                $string = str_replace( "\0", '', $string );
28
28
                $words  = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE );
29
29
                $words  = str_replace( "\n", $newlineEscape, $words );
30
30
                return $words;