X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..refs/tags/wordpress-2.9:/wp-admin/import/livejournal.php diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php index bfebe718..7acfaa5f 100644 --- a/wp-admin/import/livejournal.php +++ b/wp-admin/import/livejournal.php @@ -324,6 +324,10 @@ class LJ_API_Import { echo ''; } + function _normalize_tag( $matches ) { + return '<' . strtolower( $matches[1] ); + } + function import_post( $post ) { global $wpdb; @@ -350,7 +354,7 @@ class LJ_API_Import { // 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( '
', '
', $post_content ); $post_content = str_replace( '
', '
', $post_content ); @@ -531,6 +535,7 @@ class LJ_API_Import { // 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 @@ -581,7 +586,7 @@ class LJ_API_Import { $comment_content = wpautop( $comment_content ); $comment_content = str_replace( '
', '
', $comment_content ); $comment_content = str_replace( '
', '
', $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 @@ -720,7 +725,7 @@ class LJ_API_Import { $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 ) ) { ?>

and password so we can download your posts and comments.' ) ?>