Fix Bug #30322 “SVG metadata is read incorrectly” by applying supplied patch
authorMark A. Hershberger <mah@users.mediawiki.org>
Thu, 11 Aug 2011 19:51:51 +0000 (19:51 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Thu, 11 Aug 2011 19:51:51 +0000 (19:51 +0000)
includes/media/SVGMetadataExtractor.php

index 791c510..22ef8e6 100644 (file)
@@ -55,7 +55,7 @@ class SVGReader {
                $size = filesize( $source );
                if ( $size === false ) {
                        throw new MWException( "Error getting filesize of SVG." );
-               } 
+               }
 
                if ( $size > $wgSVGMetadataCutoff ) {
                        $this->debug( "SVG is $size bytes, which is bigger than $wgSVGMetadataCutoff. Truncating." );
@@ -157,7 +157,7 @@ class SVGReader {
                }
                $keepReading = $this->reader->read();
                while( $keepReading ) {
-                       if( $this->reader->localName == $name && $this->namespaceURI == self::NS_SVG && $this->reader->nodeType == XmlReader::END_ELEMENT ) {
+                       if( $this->reader->localName == $name && $this->reader->namespaceURI == self::NS_SVG && $this->reader->nodeType == XmlReader::END_ELEMENT ) {
                                break;
                        } elseif( $this->reader->nodeType == XmlReader::TEXT ){
                                $this->metadata[$metafield] = trim( $this->reader->value );