If the unknown element is empty, there won't be a matching END_ELEMENT. There's nothi...
[lhc/web/wiklou.git] / includes / media / SVGMetadataExtractor.php
index 42c914e..967d671 100644 (file)
@@ -49,9 +49,6 @@ class SVGReader {
        function __construct( $source ) {
                $this->reader = new XMLReader();
                $this->reader->open( $source, null, LIBXML_NOERROR | LIBXML_NOWARNING );
-               #$this->reader->setParserProperty( XMLReader::DEFAULTATTRS, FALSE );
-               #$this->reader->setParserProperty( XMLReader::DEFAULTATTRS, FALSE );
-               #$this->reader->setParserProperty( XMLReader::VALIDATE , FALSE );
 
                $this->metadata['width'] = self::DEFAULT_WIDTH;
                $this->metadata['height'] = self::DEFAULT_HEIGHT;
@@ -164,10 +161,13 @@ class SVGReader {
         * @param String $name of the element that we are reading from
         */
        private function animateFilter( $name ) {
-               $this->debug ( "animate filter" );
+               $this->debug ( "animate filter for tag $name" );
                if( $this->reader->nodeType != XmlReader::ELEMENT ) {
                        return;
                }
+               if ( $this->reader->isEmptyElement ) {
+                       return;
+               }
                $exitDepth =  $this->reader->depth;
                $keepReading = $this->reader->read();
                while( $keepReading ) {