mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
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:
@@ -550,7 +550,7 @@ class Blogger_Import {
|
||||
$post_status = isset( $entry->draft ) ? 'draft' : 'publish';
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -603,7 +603,7 @@ class Blogger_Import {
|
||||
$comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) );
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
$comment_content = str_replace('<br>', '<br />', $comment_content);
|
||||
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ class BW_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);
|
||||
$post_content = $wpdb->escape($post_content);
|
||||
@@ -129,7 +129,7 @@ class BW_Import {
|
||||
$comment_content = $this->unhtmlentities($comment_content);
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
$comment_content = str_replace('<br>', '<br />', $comment_content);
|
||||
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
|
||||
$comment_content = $wpdb->escape($comment_content);
|
||||
|
||||
@@ -71,7 +71,7 @@ class LJ_Import {
|
||||
$post_content = $this->unhtmlentities($post_content);
|
||||
|
||||
// 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);
|
||||
$post_content = $wpdb->escape($post_content);
|
||||
@@ -107,7 +107,7 @@ class LJ_Import {
|
||||
$comment_content = $this->unhtmlentities($comment_content);
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
$comment_content = str_replace('<br>', '<br />', $comment_content);
|
||||
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
|
||||
$comment_content = $wpdb->escape($comment_content);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -381,12 +381,12 @@ class WP_Import {
|
||||
$post_author = $this->get_tag( $post, 'dc:creator' );
|
||||
|
||||
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
|
||||
$post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
|
||||
$post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt);
|
||||
$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
|
||||
$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
|
||||
|
||||
$post_content = $this->get_tag( $post, 'content:encoded' );
|
||||
$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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user