Make WordPress Core


Ignore:
Timestamp:
07/05/2006 10:00:03 PM (19 years ago)
Author:
ryan
Message:

Use wp_die(). Props filosofo. fixes #2914

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/blogger.php

    r3928 r3985  
    242242            preg_match_all('#posts\.g\?blogID=(\d+)">([^<]+)</a>#U', $response['body'], $blogsary);
    243243            if ( ! count( $blogsary[1] < 1 ) )
    244                 die(__('No blogs found for this user.'));
     244                wp_die(__('No blogs found for this user.'));
    245245            $this->import['blogs'] = array();
    246246            $template = '<MainPage><br /><br /><br /><p>'.__('Are you looking for %title%? It is temporarily out of service. Please try again in a few minutes. Meanwhile, discover <a href="http://wordpress.org/">a better blogging tool</a>.').'</p><BloggerArchives><a class="archive" href="<$BlogArchiveURL$>"><$BlogArchiveName$></a><br /></BloggerArchives></MainPage><ArchivePage><Blogger><wordpresspost><$BlogItemDateTime$>|W|P|<$BlogItemAuthorNickname$>|W|P|<$BlogItemBody$>|W|P|<$BlogItemNumber$>|W|P|<$BlogItemTitle$>|W|P|<$BlogItemAuthorEmail$><BlogItemCommentsEnabled><BlogItemComments><wordpresscomment><$BlogCommentDateTime$>|W|P|<$BlogCommentAuthor$>|W|P|<$BlogCommentBody$></BlogItemComments></BlogItemCommentsEnabled></Blogger></ArchivePage>';
     
    307307                            $response = $this->get_blogger("http://www.blogger.com/blog-publishing.g?blogID={$_GET['blog']}&publishMode=0", $headers);
    308308                            if ( $response['code'] >= 400 )
    309                                 die('<h2>'.__('Failed attempt to change publish mode from FTP to BlogSpot.').'</h2><pre>' . addslashes(print_r($headers, 1)) . addslashes(print_r($response, 1)) . '</pre>');
     309                                wp_die('<h2>'.__('Failed attempt to change publish mode from FTP to BlogSpot.').'</h2><pre>' . addslashes(print_r($headers, 1)) . addslashes(print_r($response, 1)) . '</pre>');
    310310                            $this->import['blogs'][$_GET['blog']]['url'] = 'http://' . $optary['modify']['subdomain'] . '.blogspot.com/';
    311311                            sleep(2);
     
    322322                    $response = $this->post_blogger($posturl, $headers, $paramary);
    323323                    if ( $response['code'] >= 400 || strstr($response['body'], 'There are errors on this form') )
    324                         die('<p>'.__('Error on form submission. Retry or reset the importer.').'</p>' . addslashes(print_r($response, 1)));
     324                        wp_die('<p>'.__('Error on form submission. Retry or reset the importer.').'</p>' . addslashes(print_r($response, 1)));
    325325                }
    326326                $output .= "<del><p>$blog_opt</p></del>\n";
     
    365365        $bloghtml = $this->get_blogger($this->import['blogs'][$_GET['blog']]['url']);
    366366        if (! strstr($bloghtml['body'], '<a class="archive"') )
    367             die(__('Your Blogger blog did not take the new template or did not respond.'));
     367            wp_die(__('Your Blogger blog did not take the new template or did not respond.'));
    368368        preg_match_all('#<a class="archive" href="([^"]*)"#', $bloghtml['body'], $archives);
    369369        foreach ($archives[1] as $archive) {
     
    547547                        sleep(2);
    548548                        if ( $response['code'] >= 400 )
    549                             die('<h1>Error restoring publishMode.</h1><p>Please tell the devs.</p>' . addslashes(print_r($response, 1)) );
     549                            wp_die('<h1>Error restoring publishMode.</h1><p>Please tell the devs.</p>' . addslashes(print_r($response, 1)) );
    550550                    }
    551551                }
     
    616616            }
    617617//echo "Step $step.";
    618 //die('<pre>'.print_r($this->import,1).'</pre');
     618//wp_die('<pre>'.print_r($this->import,1).'</pre');
    619619            switch ($step) {
    620620                case 0 :
Note: See TracChangeset for help on using the changeset viewer.