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

View File

@@ -1317,8 +1317,7 @@ function wp_iso_descrambler($string) {
return $string;
} else {
$subject = str_replace('_', ' ', $matches[2]);
/** @todo use preg_replace_callback() */
$subject = preg_replace('#\=([0-9a-f]{2})#ei', "chr(hexdec(strtolower('$1')))", $subject);
$subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject);
return $subject;
}
}