From: Derk-Jan Hartman Date: Thu, 4 Nov 2010 13:42:42 +0000 (+0000) Subject: Skip comments and stuff before the element. X-Git-Tag: 1.31.0-rc.0~34096 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=c14f7baedaea472483923ef1e18f1dca72a288e3;p=lhc%2Fweb%2Fwiklou.git Skip comments and stuff before the element. --- diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index 66dc1259dc..a46d8389dc 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -67,18 +67,21 @@ class SVGReader { * Read the SVG */ public function read() { - $this->reader->read(); + $keepReading = $this->reader->read(); + + /* Skip until first element */ + while( $keepReading && $this->reader->nodeType != XmlReader::ELEMENT ) { + $keepReading = $this->reader->read(); + } if ( $this->reader->name != 'svg' ) { throw new MWException( "Expected tag, got ". $this->reader->name ); } $this->debug( " tag is correct." ); - - $this->debug( "Starting primary dump processing loop." ); $this->handleSVGAttribs(); - $exitDepth = $this->reader->depth; + $exitDepth = $this->reader->depth; $keepReading = $this->reader->read(); $skip = false; while ( $keepReading ) {