From 92054191a1225c1251aba6cea38cf77667776f86 Mon Sep 17 00:00:00 2001 From: Jon Cave Date: Wed, 21 Sep 2011 20:39:21 +0000 Subject: [PATCH] wp_strip_all_tags() in wp_trim_words() to remove CSS and JS within tags. Props evansolomon. Fixes #18726. git-svn-id: https://develop.svn.wordpress.org/trunk@18742 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 14ad1a080d..90d0146197 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -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 );