From 898d025430e23350743e3db2e9cf9f7c0f6e2e4c Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 14 Mar 2006 02:48:36 +0000 Subject: [PATCH] ent2ncr optimization. Props random. fixes #2548 git-svn-id: http://svn.automattic.com/wordpress/trunk@3641 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions-formatting.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index feae447a0..6563d8e3d 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -1001,10 +1001,7 @@ function ent2ncr($text) { '♦' => '♦' ); - foreach ($to_ncr as $entity => $ncr) { - $text = str_replace($entity, $ncr, $text); - } - return $text; + return str_replace( array_keys($to_ncr), array_values($to_ncr), $text ); } function wp_richedit_pre($text) {