Index: trunk/phase3/includes/media/SVGMetadataExtractor.php |
— | — | @@ -67,18 +67,21 @@ |
68 | 68 | * Read the SVG |
69 | 69 | */ |
70 | 70 | public function read() { |
71 | | - $this->reader->read(); |
| 71 | + $keepReading = $this->reader->read(); |
72 | 72 | |
| 73 | + /* Skip until first element */ |
| 74 | + while( $keepReading && $this->reader->nodeType != XmlReader::ELEMENT ) { |
| 75 | + $keepReading = $this->reader->read(); |
| 76 | + } |
| 77 | + |
73 | 78 | if ( $this->reader->name != 'svg' ) { |
74 | 79 | throw new MWException( "Expected <svg> tag, got ". |
75 | 80 | $this->reader->name ); |
76 | 81 | } |
77 | 82 | $this->debug( "<svg> tag is correct." ); |
| 83 | + $this->handleSVGAttribs(); |
78 | 84 | |
79 | | - $this->debug( "Starting primary dump processing loop." ); |
80 | | - $this->handleSVGAttribs(); |
81 | 85 | $exitDepth = $this->reader->depth; |
82 | | - |
83 | 86 | $keepReading = $this->reader->read(); |
84 | 87 | $skip = false; |
85 | 88 | while ( $keepReading ) { |