X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fmedia%2FSVGMetadataExtractor.php;h=bc5eb09a4f4485cff6ec3c21b00d04e7b864e57a;hb=3f134f0834d530107ab9b7a76edac934521bb8ad;hp=ca398ff14fb37e7d3e455fc69622f7a2447f32d4;hpb=f186496005a47a09aed6d46feea7302fe9d5f0e2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index ca398ff14f..bc5eb09a4f 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -74,7 +74,7 @@ class SVGReader { if ( $size > $wgSVGMetadataCutoff ) { $this->debug( "SVG is $size bytes, which is bigger than $wgSVGMetadataCutoff. Truncating." ); - $contents = file_get_contents( $source, false, null, -1, $wgSVGMetadataCutoff ); + $contents = file_get_contents( $source, false, null, 0, $wgSVGMetadataCutoff ); if ( $contents === false ) { throw new MWException( 'Error reading SVG file.' ); } @@ -226,13 +226,8 @@ class SVGReader { return; } // @todo Find and store type of xml snippet. metadata['metadataType'] = "rdf" - if ( method_exists( $this->reader, 'readInnerXML' ) ) { - $this->metadata[$metafield] = trim( $this->reader->readInnerXml() ); - } else { - throw new MWException( "The PHP XMLReader extension does not come " . - "with readInnerXML() method. Your libxml is probably out of " . - "date (need 2.6.20 or later)." ); - } + $this->metadata[$metafield] = trim( $this->reader->readInnerXml() ); + $this->reader->next(); }