WordPress.org

Make WordPress Core

Ticket #21597: parsers.diff

File parsers.diff, 614 bytes (added by lightningspirit, 6 years ago)
  • parsers.php

     
    7272                        return new WP_Error( 'WXR_parse_error', __( 'This does not appear to be a WXR file, missing/invalid WXR version number', 'wordpress-importer' ) );
    7373
    7474                $base_url = $xml->xpath('/rss/channel/wp:base_site_url');
    75                 $base_url = (string) trim( $base_url[0] );
     75                if ( $base_url )
     76                        $base_url = (string) trim( $base_url[0] );
     77                else
     78                        $base_url = false;
    7679
    7780                $namespaces = $xml->getDocNamespaces();
    7881                if ( ! isset( $namespaces['wp'] ) )