Ticket #10376: formatting-preg-split.php.diff
File formatting-preg-split.php.diff, 668 bytes (added by , 16 years ago) |
---|
-
trunk/wp-includes/formatting.php
1696 1696 1697 1697 $text = apply_filters('the_content', $text); 1698 1698 $text = str_replace(']]>', ']]>', $text); 1699 $text = strip_tags($text);1700 1699 $excerpt_length = apply_filters('excerpt_length', 55); 1701 $words = explode(' ', $text, $excerpt_length + 1);1700 $words = preg_split('/\s+/', strip_tags($text), $excerpt_length + 1, PREG_SPLIT_NO_EMPTY); 1702 1701 if (count($words) > $excerpt_length) { 1703 1702 array_pop($words); 1704 1703 array_push($words, '[...]');