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:
Mark Jaquith
2007-07-06 12:53:15 +00:00
parent 9817ec9e74
commit 258e179448
3 changed files with 15 additions and 2 deletions
+11
View File
@@ -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];
}
?>