mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
wp_strip_all_tags() in wp_trim_words() to remove CSS and JS within tags. Props evansolomon. Fixes #18726.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3c2ba4afed
commit
2fb95a133d
@ -1884,7 +1884,7 @@ function wp_trim_words( $text, $num_words = 55, $more = null ) {
|
||||
if ( null === $more )
|
||||
$more = __( '…' );
|
||||
$original_text = $text;
|
||||
$text = strip_tags( $text );
|
||||
$text = wp_strip_all_tags( $text );
|
||||
$words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
|
||||
if ( count( $words_array ) > $num_words ) {
|
||||
array_pop( $words_array );
|
||||
|
Loading…
Reference in New Issue
Block a user