Use preg_replace_callback instead of preg_replace with eval. Props beaulebens. see #8689

git-svn-id: https://develop.svn.wordpress.org/trunk@10339 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-01-09 19:29:35 +00:00
parent ee141fe280
commit 2baa2f8e58
8 changed files with 18 additions and 16 deletions
+1 -1
View File
@@ -223,7 +223,7 @@ function get_the_content($more_link_text = null, $stripteaser = 0, $more_file =
}
if ( $preview ) // preview fix for javascript bug with foreign languages
$output = preg_replace('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output);
$output = preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output);
return $output;
}