diff options
-rw-r--r-- | include/functions.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index b2ff209a0..7ea90a6f9 100644 --- a/include/functions.php +++ b/include/functions.php @@ -5127,6 +5127,22 @@ if ($doc) { $xpath = new DOMXpath($doc); + + $container = $doc->firstChild; + + if ($container && $container->hasAttribute('schema-version')) { + $schema_version = $container->getAttribute('schema-version'); + + if ($schema_version != SCHEMA_VERSION) { + print "<p>" .__("Could not import: incorrect schema version.") . "</p>"; + return; + } + + } else { + print "<p>" . __("Could not import: unrecognized document format.") . "</p>"; + return; + } + $articles = $xpath->query("//article"); foreach ($articles as $article_node) { |