Make WordPress Core


Ignore:
Timestamp:
07/06/2007 12:53:15 PM (18 years ago)
Author:
markjaquith
Message:

Entitize lone less-than characters. Props mdawaffe. fixes #4409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r5734 r5783  
    11961196}
    11971197
     1198// Convert lone less than signs.  KSES already converts lone greater than signs.
     1199function wp_pre_kses_less_than( $text ) {
     1200    return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text);
     1201}
     1202
     1203function wp_pre_kses_less_than_callback( $matches ) {
     1204    if ( false === strpos($matches[0], '>') )
     1205        return wp_specialchars($matches[0]);
     1206    return $matches[0];
     1207}
     1208
    11981209?>
Note: See TracChangeset for help on using the changeset viewer.