Make WordPress Core

Ticket #3971: 3971.diff

File 3971.diff, 1.7 KB (added by foolswisdom, 18 years ago)
  • wp-admin/import/blogger.php

     
    8484                if ( empty($this->blogs) ) {
    8585                        $headers = array(
    8686                                "GET /feeds/default/blogs HTTP/1.0",
    87                                 "Host: www.blogger.com",
     87                                "Host: www2.blogger.com",
    8888                                "Authorization: AuthSub token=\"$this->token\""
    8989                        );
    9090                        $request = join( "\r\n", $headers ) . "\r\n\r\n";
     
    547547                }
    548548
    549549                $comment_post_ID = $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink];
    550                 $comment_author  = addslashes( $this->no_apos( strip_tags( $entry->author ) ) );
     550                preg_match('#<name>(.+?)</name>.*(?:\<uri>(.+?)</uri>)?#', $entry->author, $matches);
     551                $comment_author  = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) );
     552                $comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) );
    551553                $comment_date    = $this->convert_date( $entry->updated );
    552554                $comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) );
    553555
     
    563565                ) {
    564566                        ++$this->blogs[$importing_blog]['comments_skipped'];
    565567                } else {
    566                         $comment = compact('comment_post_ID', 'comment_author', 'comment_date', 'comment_content');
     568                        $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content');
    567569
    568570                        $comment_id = wp_insert_comment($comment);
    569571
     
    672674                return $sock;
    673675        }
    674676
    675         function _get_blogger_sock($host = 'www.blogger.com') {
     677        function _get_blogger_sock($host = 'www2.blogger.com') {
    676678                if ( !$sock = @ fsockopen($host, 80, $errno, $errstr) ) {
    677679                        $this->uh_oh(
    678680                                sprintf( __('Could not connect to %s'), $host ),