mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Security: Clean up user inputs before using.
git-svn-id: https://develop.svn.wordpress.org/trunk@1727 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1716,4 +1716,12 @@ function get_template_directory() {
|
||||
return $template;
|
||||
}
|
||||
|
||||
// Borrowed from the PHP Manual user notes. Convert entities, while
|
||||
// preserving already-encoded entities:
|
||||
function htmlentities2($myHTML) {
|
||||
$translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES);
|
||||
$translation_table[chr(38)] = '&';
|
||||
return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table));
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user