• Resolved Somesh79

    (@somesh79)


    Replace in file parsers.php in plugin wordpress-importer at Class WXR_Parser_SimpleXML

    $dom = new DOMDocument;
    $old_value = null;
    if ( function_exists( ‘libxml_disable_entity_loader’ ) ) {
    $old_value = libxml_disable_entity_loader( true );
    }
    $success = $dom->loadXML( file_get_contents( $file ) );
    if ( ! is_null( $old_value ) ) {
    libxml_disable_entity_loader( $old_value );
    }

    if ( ! $success || isset( $dom->doctype ) ) {
    return new WP_Error( ‘SimpleXML_parse_error’, __( ‘There was an error when reading this WXR file’, ‘wordpress-importer’ ), libxml_get_errors() );
    }

    $xml = simplexml_import_dom( $dom );
    unset( $dom );

    For:
    $xml = simplexml_load_file($file);

Viewing 1 replies (of 1 total)
  • Thread Starter Somesh79

    (@somesh79)

    Just replace

    $xml = simplexml_import_dom( $dom );

    with

    $xml = simplexml_load_file($file);

Viewing 1 replies (of 1 total)
  • The topic ‘Error while upload or import due to dom document not found’ is closed to new replies.