Ticket #2130: kses-comments.diff

File kses-comments.diff, 0.7 kB (added by skeltoac, 3 years ago)
  • wp-includes/kses.php

    old new  
    9898                return '>'; 
    9999        # It matched a ">" character 
    100100 
    101         if (preg_match('%^<!--.*-->$%', $string)) 
    102                 return $string; 
     101        if (preg_match('%^<!--(.*)-->$%', $string, $matches)) { 
     102                $string = $matches[1]; 
     103                while ( $string != $newstring = wp_kses($string, $allowed_html, $allowed_protocols) ) 
     104                        $string = $newstring; 
     105                return "<!--{$string}-->"; 
     106        } 
    103107        # Allow HTML comments 
    104108 
    105109        if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches))