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
@@ -103,7 +103,7 @@ class RSS_Import {
}
// Clean up content
$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
$post_content = str_replace('<br>', '<br />', $post_content);
$post_content = str_replace('<hr>', '<hr />', $post_content);