From 2fb95a133d74d59274bb86612d118ad4026550cb Mon Sep 17 00:00:00 2001 From: duck_ 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: http://svn.automattic.com/wordpress/trunk@18742 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 14ad1a080..90d014619 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 );