Make WordPress Core


Ignore:
Timestamp:
01/09/2009 07:29:35 PM (18 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/blogware.php

    r9903 r10339  
    9090
    9191                        // Clean up content
    92                         $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
     92                        $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
    9393                        $post_content = str_replace('<br>', '<br />', $post_content);
    9494                        $post_content = str_replace('<hr>', '<hr />', $post_content);
     
    130130
    131131                                        // Clean up content
    132                                         $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
     132                                        $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
    133133                                        $comment_content = str_replace('<br>', '<br />', $comment_content);
    134134                                        $comment_content = str_replace('<hr>', '<hr />', $comment_content);
Note: See TracChangeset for help on using the changeset viewer.