From 0d4e7d2db3c8fbbf467e3400548792841bd47325 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 19 Apr 2006 03:03:27 +0000 Subject: [PATCH] Move htmlentities2 to functions-formatting.php. #2525 git-svn-id: https://develop.svn.wordpress.org/trunk@3717 602fd350-edb4-49c9-b593-d223f7449a82 --- 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; } + ?>