From 82d2869415256517dbe9d15557e6b0545de7ab9c Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 28 Oct 2010 07:25:30 +0000 Subject: [PATCH] Remove create_function usage during preview. See #14424 props ScottMac. git-svn-id: https://develop.svn.wordpress.org/trunk@16034 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 2a8a2d6bd1..ec506d3a49 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -223,11 +223,23 @@ function get_the_content($more_link_text = null, $stripteaser = 0) { } if ( $preview ) // preview fix for javascript bug with foreign languages - $output = preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output); + $output = preg_replace_callback('/\%u([0-9A-F]{4})/', '__convert_urlencoded_to_entities', $output); return $output; } +/** + * Preview fix for javascript bug with foreign languages + * + * @since 3.1.0 + * @access private + * @param array $match Match array from preg_replace_callback + * @returns string + */ +function __convert_urlencoded_to_entities($match) { + return '&#' . base_convert($match[1], 16, 10) . ';'; +} + /** * Display the post excerpt. *