summaryrefslogtreecommitdiff
path: root/includes/media/SVGMetadataExtractor.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/media/SVGMetadataExtractor.php')
-rw-r--r--includes/media/SVGMetadataExtractor.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php
index 22ef8e61..db9f05fd 100644
--- a/includes/media/SVGMetadataExtractor.php
+++ b/includes/media/SVGMetadataExtractor.php
@@ -68,6 +68,12 @@ class SVGReader {
$this->reader->open( $source, null, LIBXML_NOERROR | LIBXML_NOWARNING );
}
+ // Expand entities, since Adobe Illustrator uses them for xmlns
+ // attributes (bug 31719). Note that libxml2 has some protection
+ // against large recursive entity expansions so this is not as
+ // insecure as it might appear to be.
+ $this->reader->setParserProperty( XMLReader::SUBST_ENTITIES, true );
+
$this->metadata['width'] = self::DEFAULT_WIDTH;
$this->metadata['height'] = self::DEFAULT_HEIGHT;
@@ -166,7 +172,7 @@ class SVGReader {
}
}
- /*
+ /**
* Read an XML snippet from an element
*
* @param String $metafield that we will fill with the result