mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Entitize lone less-than characters. Props mdawaffe. fixes #4409
git-svn-id: https://develop.svn.wordpress.org/trunk@5783 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1195,4 +1195,15 @@ function wp_parse_str( $string, &$array ) {
|
||||
$array = apply_filters( 'wp_parse_str', $array );
|
||||
}
|
||||
|
||||
// Convert lone less than signs. KSES already converts lone greater than signs.
|
||||
function wp_pre_kses_less_than( $text ) {
|
||||
return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text);
|
||||
}
|
||||
|
||||
function wp_pre_kses_less_than_callback( $matches ) {
|
||||
if ( false === strpos($matches[0], '>') )
|
||||
return wp_specialchars($matches[0]);
|
||||
return $matches[0];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user