]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/import/livejournal.php
Wordpress 2.9.1-scripts
[autoinstalls/wordpress.git] / wp-admin / import / livejournal.php
index bfebe718b9ff9c53a824186e7d3b0a402b548a32..7acfaa5fee2ee5224390b1ffd2d4ebf0447a858d 100644 (file)
@@ -324,6 +324,10 @@ class LJ_API_Import {
                echo '</ol>';
        }
 
                echo '</ol>';
        }
 
+       function _normalize_tag( $matches ) {
+               return '<' . strtolower( $matches[1] );
+       }
+
        function import_post( $post ) {
                global $wpdb;
 
        function import_post( $post ) {
                global $wpdb;
 
@@ -350,7 +354,7 @@ class LJ_API_Import {
 
                // Clean up content
                $post_content = $post['event'];
 
                // Clean up content
                $post_content = $post['event'];
-               $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 );
                // XHTMLize some tags
                $post_content = str_replace( '<br>', '<br />', $post_content );
                $post_content = str_replace( '<hr>', '<hr />', $post_content );
                // XHTMLize some tags
                $post_content = str_replace( '<br>', '<br />', $post_content );
                $post_content = str_replace( '<hr>', '<hr />', $post_content );
@@ -531,6 +535,7 @@ class LJ_API_Import {
 
                                // Parse this comment into an array and insert
                                $comment = $this->parse_comment( $comment );
 
                                // Parse this comment into an array and insert
                                $comment = $this->parse_comment( $comment );
+                               $comment = wp_filter_comment( $comment );
                                $id = wp_insert_comment( $comment );
 
                                // Clear cache
                                $id = wp_insert_comment( $comment );
 
                                // Clear cache
@@ -581,7 +586,7 @@ class LJ_API_Import {
                $comment_content = wpautop( $comment_content );
                $comment_content = str_replace( '<br>', '<br />', $comment_content );
                $comment_content = str_replace( '<hr>', '<hr />', $comment_content );
                $comment_content = wpautop( $comment_content );
                $comment_content = str_replace( '<br>', '<br />', $comment_content );
                $comment_content = str_replace( '<hr>', '<hr />', $comment_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 = $wpdb->escape( trim( $comment_content ) );
 
                // Get and convert the date
                $comment_content = $wpdb->escape( trim( $comment_content ) );
 
                // Get and convert the date
@@ -720,7 +725,7 @@ class LJ_API_Import {
                        $this->protected_password = get_option( 'ljapi_protected_password' );
                }
 
                        $this->protected_password = get_option( 'ljapi_protected_password' );
                }
 
-               // Login to confirm the details are correct
+               // Log in to confirm the details are correct
                if ( empty( $this->username ) || empty( $this->password ) ) {
                        ?>
                        <p><?php _e( 'Please enter your LiveJournal username <em>and</em> password so we can download your posts and comments.' ) ?></p>
                if ( empty( $this->username ) || empty( $this->password ) ) {
                        ?>
                        <p><?php _e( 'Please enter your LiveJournal username <em>and</em> password so we can download your posts and comments.' ) ?></p>