Error while upload or import due to dom document not found
-
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);
- The topic ‘Error while upload or import due to dom document not found’ is closed to new replies.