diff --git a/application/src/File/TempFile.php b/application/src/File/TempFile.php index 32d12b468f..1d826ef16b 100644 --- a/application/src/File/TempFile.php +++ b/application/src/File/TempFile.php @@ -84,20 +84,20 @@ class TempFile 'http://www.w3.org/2005/Atom' => 'application/atom+xml', 'http://purl.org/rss/1.0/' => 'application/rss+xml', // Common in library and culture world. - 'http://bibnum.bnf.fr/ns/alto_prod' => 'application/vnd.alto+xml', + 'http://bibnum.bnf.fr/ns/alto_prod' => 'application/alto+xml', 'http://bibnum.bnf.fr/ns/refNum' => 'application/vnd.bnf.refnum+xml', 'http://www.iccu.sbn.it/metaAG1.pdf' => 'application/vnd.iccu.mag+xml', - 'http://www.loc.gov/MARC21/slim' => 'application/vnd.marc21+xml', - 'http://www.loc.gov/METS/' => 'application/vnd.mets+xml', - 'http://www.loc.gov/mods/' => 'application/vnd.mods+xml', - 'http://www.loc.gov/standards/alto/ns-v3#' => 'application/vnd.alto+xml', + 'http://www.loc.gov/MARC21/slim' => 'application/marcxml+xml', + 'http://www.loc.gov/METS/' => 'application/mets+xml', + 'http://www.loc.gov/mods/' => 'application/mods+xml', + 'http://www.loc.gov/standards/alto/ns-v3#' => 'application/alto+xml', 'http://www.music-encoding.org/ns/mei' => 'application/vnd.mei+xml', 'http://www.music-encoding.org/schema/3.0.0/mei-all.rng' => 'application/vnd.mei+xml', // See https://github.com/w3c/musicxml/blob/gh-pages/schema/musicxml.xsd - 'http://www.musicxml.org/xsd/MusicXML' => 'application/vnd.recordare.musicxml', + 'http://www.musicxml.org/xsd/MusicXML' => 'application/vnd.recordare.musicxml+xml', 'http://www.openarchives.org/OAI/2.0/' => 'application/vnd.openarchives.oai-pmh+xml', 'http://www.openarchives.org/OAI/2.0/static-repository' => 'application/vnd.openarchives.oai-pmh+xml', - 'http://www.tei-c.org/ns/1.0' => 'application/vnd.tei+xml', + 'http://www.tei-c.org/ns/1.0' => 'application/tei+xml', // Omeka should support itself. 'http://omeka.org/schemas/omeka-xml/v1' => 'text/vnd.omeka+xml', 'http://omeka.org/schemas/omeka-xml/v2' => 'text/vnd.omeka+xml', @@ -105,21 +105,22 @@ class TempFile 'http://omeka.org/schemas/omeka-xml/v4' => 'text/vnd.omeka+xml', 'http://omeka.org/schemas/omeka-xml/v5' => 'text/vnd.omeka+xml', // Doctype and root elements in case there is no namespace. - 'alto' => 'application/vnd.alto+xml', + 'alto' => 'application/alto+xml', 'ead' => 'application/vnd.ead+xml', 'feed' => 'application/atom+xml', 'html' => 'text/html', 'mag' => 'application/vnd.iccu.mag+xml', 'mei' => 'application/vnd.mei+xml', - 'mets' => 'application/vnd.mets+xml', - 'mods' => 'application/vnd.mods+xml', + 'mets' => 'application/mets+xml', + 'mods' => 'application/mods+xml', 'pdf2xml' => 'application/vnd.pdf2xml+xml', 'refNum' => 'application/vnd.bnf.refnum+xml', 'rss' => 'application/rss+xml', - 'score-partwise' => 'application/vnd.recordare.musicxml', + 'score-partwise' => 'application/vnd.recordare.musicxml+xml', 'svg' => 'image/svg+xml', - 'TEI' => 'application/vnd.tei+xml', + 'TEI' => 'application/tei+xml', // 'collection' => 'application/vnd.marc21+xml', + 'xhtml' => 'application/xhtml+xml', ]; /** @@ -541,8 +542,13 @@ protected function getMediaTypeXml() break; } + // To be improved or skipped. if ($reader->nodeType === XMLReader::PI - && !in_array($reader->name, ['xml-stylesheet', 'oxygen']) + && !in_array($reader->name, [ + 'xml-model', + 'xml-stylesheet', + 'oxygen', + ]) ) { $matches = []; if (preg_match('~href="(.+?)"~mi', $reader->value, $matches)) { @@ -578,9 +584,7 @@ protected function getMediaTypeXml() } */ - return isset($this->xmlMediaTypes[$type]) - ? $this->xmlMediaTypes[$type] - : null; + return $this->mediaTypeIdentifiers[$type] ?? null; } /**