Move htmlentities2 to functions-formatting.php. #2525

git-svn-id: http://svn.automattic.com/wordpress/trunk@3717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-04-19 03:03:27 +00:00
parent 78e9a489f2
commit bb0efd050b
2 changed files with 9 additions and 8 deletions

View File

@ -1032,4 +1032,12 @@ function clean_url( $url ) {
return $url; return $url;
} }
// 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));
}
?> ?>

View File

@ -1363,14 +1363,6 @@ function wp_footer() {
do_action('wp_footer'); do_action('wp_footer');
} }
// 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));
}
/* /*
add_query_arg: Returns a modified querystring by adding add_query_arg: Returns a modified querystring by adding
a single key & value or an associative array. a single key & value or an associative array.
@ -1670,4 +1662,5 @@ function is_blog_installed() {
$wpdb->show_errors(); $wpdb->show_errors();
return $installed; return $installed;
} }
?> ?>