Ticket #2130: kses.php.2.diff

File kses.php.2.diff, 0.8 kB (added by tsimmons, 3 years ago)

New version of suggested patch

  • wp-includes/kses.php

    old new  
    7777# matches stray ">" characters. 
    7878############################################################################### 
    7979{ 
    80         return preg_replace('%(<'.# EITHER: < 
     80        return preg_replace('%(<!--.*-->)|(<'.# EITHER: < 
    8181        '[^>]*'.# things that aren't > 
    8282        '(>|$)'.# > or end of string 
    8383        '|>)%e', # OR: just a > 
     
    9898                return '&gt;'; 
    9999        # It matched a ">" character 
    100100 
     101        if (preg_match('%^<!--.*-->$%', $string)) 
     102                return $string; 
     103        # Allow HTML comments 
     104 
    101105        if (!preg_match('%^<\s*(/\s*)?([a-zA-Z0-9]+)([^>]*)>?$%', $string, $matches)) 
    102106                return ''; 
    103107        # It's seriously malformed