r76002 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76001‎ | r76002 | r76003 >
Date:13:42, 4 November 2010
Author:hartman
Status:ok
Tags:
Comment:
Skip comments and stuff before the <svg> element.
Modified paths:
  • /trunk/phase3/includes/media/SVGMetadataExtractor.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/media/SVGMetadataExtractor.php
@@ -67,18 +67,21 @@
6868 * Read the SVG
6969 */
7070 public function read() {
71 - $this->reader->read();
 71+ $keepReading = $this->reader->read();
7272
 73+ /* Skip until first element */
 74+ while( $keepReading && $this->reader->nodeType != XmlReader::ELEMENT ) {
 75+ $keepReading = $this->reader->read();
 76+ }
 77+
7378 if ( $this->reader->name != 'svg' ) {
7479 throw new MWException( "Expected <svg> tag, got ".
7580 $this->reader->name );
7681 }
7782 $this->debug( "<svg> tag is correct." );
 83+ $this->handleSVGAttribs();
7884
79 - $this->debug( "Starting primary dump processing loop." );
80 - $this->handleSVGAttribs();
8185 $exitDepth = $this->reader->depth;
82 -
8386 $keepReading = $this->reader->read();
8487 $skip = false;
8588 while ( $keepReading ) {

Status & tagging log