Ticket #15657: formatting-wp_strip_all_tags.diff
File formatting-wp_strip_all_tags.diff, 824 bytes (added by , 13 years ago) |
---|
-
wp-includes/formatting.php
2908 2908 */ 2909 2909 function wp_strip_all_tags($string, $remove_breaks = false) { 2910 2910 $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string ); 2911 $string = strip_tags($string);2912 2911 2912 $string = preg_replace( '@</?\s*(P|UL|OL|DL|BLOCKQUOTE)\b[^>]*?>@si', "\n\n", $string ); 2913 $string = preg_replace( '@<(BR|DIV|LI|DT|DD|TR|TD|H\d)\b[^>]*?>@si', "\n", $string ); 2914 $string = preg_replace( "@\n\n\n+@si", "\n\n", $string ); 2915 2916 $string = strip_tags( $string ); 2917 2913 2918 if ( $remove_breaks ) 2914 2919 $string = preg_replace('/[\r\n\t ]+/', ' ', $string); 2915 2920 2916 return trim( $string);2921 return trim( $string ); 2917 2922 } 2918 2923 2919 2924 /**