*/
function __construct() {}
- function WP_Importer() {
- $this->__construct();
- }
-
/**
* Returns array with imported permalinks from WordPress database
*
}
if ( empty( $parsed['path'] ) )
$parsed['path'] = '/';
- if ( !$blog = get_blog_info( $parsed['host'], $parsed['path'] ) ) {
+ $blog = get_blog_details( array( 'domain' => $parsed['host'], 'path' => $parsed['path'] ) );
+ if ( !$blog ) {
fwrite( STDERR, "Error: Could not find blog\n" );
exit();
}
$blog_id = (int) $blog->blog_id;
- // Restore global $current_blog
- global $current_blog;
- $current_blog = $blog;
}
if ( function_exists( 'is_multisite' ) ) {
*/
function get_page( $url, $username = '', $password = '', $head = false ) {
// Increase the timeout
- add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) );
+ add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
$headers = array();
$args = array();
$args['headers'] = $headers;
- return wp_remote_request( $url, $args );
+ return wp_safe_remote_request( $url, $args );
}
/**
* @return bool
*/
function is_user_over_quota() {
- global $current_user, $current_blog;
-
if ( function_exists( 'upload_is_user_over_quota' ) ) {
if ( upload_is_user_over_quota( 1 ) ) {
echo "Sorry, you have used your upload quota.\n";