Make WordPress Core


Ignore:
Timestamp:
09/23/2009 10:03:39 PM (16 years ago)
Author:
ryan
Message:

Use hard-coded functions instead of create_function() in importers. Props mdawaffe. fixes #10836

File:
1 edited

Legend:

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

    r11190 r11964  
    4444    }
    4545
     46    function _normalize_tag( $matches ) {
     47        return '<' . strtolower( $match[1] );
     48    }
     49
    4650    function get_posts() {
    4751        global $wpdb;
     
    104108
    105109            // Clean up content
    106             $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     110            $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
    107111            $post_content = str_replace('<br>', '<br />', $post_content);
    108112            $post_content = str_replace('<hr>', '<hr />', $post_content);
Note: See TracChangeset for help on using the changeset viewer.