Make WordPress Core


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

    r11190 r11964  
    4141        wp_import_upload_form("admin.php?import=blogware&step=1");
    4242        echo '</div>';
     43    }
     44
     45    function _normalize_tag( $matches ) {
     46        return '<' . strtolower( $match[1] );
    4347    }
    4448
     
    9094
    9195            // Clean up content
    92             $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
     96            $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
    9397            $post_content = str_replace('<br>', '<br />', $post_content);
    9498            $post_content = str_replace('<hr>', '<hr />', $post_content);
     
    130134
    131135                    // Clean up content
    132                     $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
     136                    $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
    133137                    $comment_content = str_replace('<br>', '<br />', $comment_content);
    134138                    $comment_content = str_replace('<hr>', '<hr />', $comment_content);
Note: See TracChangeset for help on using the changeset viewer.