Ticket #4298: 4298.2.diff
File 4298.2.diff, 1.5 KB (added by , 15 years ago) |
---|
-
wp-includes/default-filters.php
74 74 add_filter( $filter, 'balanceTags', 50); 75 75 } 76 76 77 // Places to filter out newlines from html tags 78 $filters = array('content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content', 'pre_term_description', 'pre_user_description', 'pre_link_description'); 79 foreach ( $filters as $filter ) { 80 add_filter( $filter, 'funky_html_fix', 1); 81 } 82 77 83 // Format strings for display. 78 84 $filters = array('comment_author', 'term_name', 'link_name', 'link_description', 79 85 'link_notes', 'bloginfo', 'wp_title', 'widget_title'); -
wp-includes/formatting.php
806 806 } 807 807 808 808 /** 809 * strip newline characters in html tags to prevent wpautop bugs 810 * 811 * @return void 812 **/ 813 814 function funky_html_fix($text) { 815 $text = str_replace(array("\r\n", "\r"), "\n", $text); 816 817 while ( preg_match("/<[^<>]*\n/", $text) ) 818 $text = preg_replace("/(<[^<>]*)\n+/", "$1", $text); 819 820 return $text; 821 } # funky_html_fix() 822 823 /** 809 824 * Will only balance the tags if forced to and the option is set to balance tags. 810 825 * 811 826 * The option 'use_balanceTags' is used for whether the tags will be balanced.