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
This commit is contained in:
parent
c7f61b2857
commit
92054191a1
|
@ -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