WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/21/2009 06:51:48 PM (11 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7/wp-admin/import/blogger.php

    r9933 r10392  
    551551
    552552        // Clean up content
    553         $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
     553        $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
    554554        $post_content = str_replace('<br>', '<br />', $post_content);
    555555        $post_content = str_replace('<hr>', '<hr />', $post_content);
     
    604604
    605605        // Clean up content
    606         $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
     606        $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
    607607        $comment_content = str_replace('<br>', '<br />', $comment_content);
    608608        $comment_content = str_replace('<hr>', '<hr />', $comment_content);
Note: See TracChangeset for help on using the changeset viewer.