From 8772cbfa138d9e46d0fcb97aa0a2a0b15e8eb6d1 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 14 Mar 2007 19:20:19 +0000 Subject: [PATCH] Blogger importer updates. fixes #3971 git-svn-id: http://svn.automattic.com/wordpress/trunk@5038 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/import/blogger.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index 92aadb6466..0e60e6d642 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -84,7 +84,7 @@ class Blogger_Import { if ( empty($this->blogs) ) { $headers = array( "GET /feeds/default/blogs HTTP/1.0", - "Host: www.blogger.com", + "Host: www2.blogger.com", "Authorization: AuthSub token=\"$this->token\"" ); $request = join( "\r\n", $headers ) . "\r\n\r\n"; @@ -547,7 +547,9 @@ class Blogger_Import { } $comment_post_ID = $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; - $comment_author = addslashes( $this->no_apos( strip_tags( $entry->author ) ) ); + preg_match('#(.+?).*(?:\(.+?))?#', $entry->author, $matches); + $comment_author = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) ); + $comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) ); $comment_date = $this->convert_date( $entry->updated ); $comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ); @@ -563,7 +565,7 @@ class Blogger_Import { ) { ++$this->blogs[$importing_blog]['comments_skipped']; } else { - $comment = compact('comment_post_ID', 'comment_author', 'comment_date', 'comment_content'); + $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content'); $comment_id = wp_insert_comment($comment); @@ -672,7 +674,7 @@ class Blogger_Import { return $sock; } - function _get_blogger_sock($host = 'www.blogger.com') { + function _get_blogger_sock($host = 'www2.blogger.com') { if ( !$sock = @ fsockopen($host, 80, $errno, $errstr) ) { $this->uh_oh( sprintf( __('Could not connect to %s'), $host ),