Ticket #2130: perfect-comments.diff
File perfect-comments.diff, 1.1 KB (added by , 19 years ago) |
---|
-
wp-includes/kses.php
77 77 # matches stray ">" characters. 78 78 ############################################################################### 79 79 { 80 return preg_replace('%(<!--.*?-->)|(<'.# EITHER: < 81 '[^>]*'.# things that aren't > 82 '(>|$)'.# > or end of string 83 '|>)%e', # OR: just a > 80 return preg_replace('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%e', 84 81 "wp_kses_split2('\\1', \$allowed_html, ".'$allowed_protocols)', $string); 85 82 } # function wp_kses_split 86 83 … … 98 95 return '>'; 99 96 # It matched a ">" character 100 97 101 if (preg_match('%^<!--(.* )-->$%', $string, $matches)) {102 $string = $matches[1];98 if (preg_match('%^<!--(.*?)(-->)?$%', $string, $matches)) { 99 $string = str_replace(array('<!--', '-->'), '', $matches[1]); 103 100 while ( $string != $newstring = wp_kses($string, $allowed_html, $allowed_protocols) ) 104 101 $string = $newstring; 102 if ( $string == '' ) 103 return ''; 105 104 return "<!--{$string}-->"; 106 105 } 107 106 # Allow HTML comments