Make WordPress Core


Ignore:
Timestamp:
09/23/2009 10:03:39 PM (17 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/wordpress.php

    r11842 r11964  
    356356
    357357                echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
     358        }
     359
     360        function _normalize_tag( $matches ) {
     361                return '<' . strtolower( $match[1] );
    358362        }
    359363
    … …  
    384388
    385389                $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
    386                 $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt);
     390                $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt);
    387391                $post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
    388392                $post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
    389393
    390394                $post_content = $this->get_tag( $post, 'content:encoded' );
    391                 $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     395                $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
    392396                $post_content = str_replace('<br>', '<br />', $post_content);
    393397                $post_content = str_replace('<hr>', '<hr />', $post_content);
Note: See TracChangeset for help on using the changeset viewer.