From bb0efd050b0de3d32681efd9d67edb7ae6710197 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 19 Apr 2006 03:03:27 +0000 Subject: [PATCH] Move htmlentities2 to functions-formatting.php. #2525 git-svn-id: http://svn.automattic.com/wordpress/trunk@3717 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions-formatting.php | 8 ++++++++ wp-includes/functions.php | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index e2d3b7e45a..8b4f9da1eb 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -1032,4 +1032,12 @@ function clean_url( $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)); +} + ?> diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e8b31624d2..1a2c890bc8 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1363,14 +1363,6 @@ function 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 a single key & value or an associative array. @@ -1670,4 +1662,5 @@ function is_blog_installed() { $wpdb->show_errors(); return $installed; } + ?>