]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/import/blogware.php
Wordpress 2.9
[autoinstalls/wordpress.git] / wp-admin / import / blogware.php
index 500a08ba240efe9348a3a78375a7e786cb0bdc3d..531ceddc7d14f2ec89ebb221418c5955fcd593c5 100644 (file)
@@ -42,6 +42,10 @@ class BW_Import {
                echo '</div>';
        }
 
+       function _normalize_tag( $matches ) {
+               return '<' . strtolower( $matches[1] );
+       }
+
        function import_posts() {
                global $wpdb, $current_user;
 
@@ -89,7 +93,7 @@ class BW_Import {
                        }
 
                        // Clean up content
-                       $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
+                       $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
                        $post_content = str_replace('<br>', '<br />', $post_content);
                        $post_content = str_replace('<hr>', '<hr />', $post_content);
                        $post_content = $wpdb->escape($post_content);
@@ -129,7 +133,7 @@ class BW_Import {
                                        $comment_content = $this->unhtmlentities($comment_content);
 
                                        // Clean up content
-                                       $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
+                                       $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
                                        $comment_content = str_replace('<br>', '<br />', $comment_content);
                                        $comment_content = str_replace('<hr>', '<hr />', $comment_content);
                                        $comment_content = $wpdb->escape($comment_content);