Pass language to Status::getWikiText
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderImage.php
index 9003951..2b0f5ed 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Class encapsulating an image used in a ResourceLoaderImageModule.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -25,6 +23,7 @@ use MediaWiki\Shell\Shell;
 /**
  * Class encapsulating an image used in a ResourceLoaderImageModule.
  *
+ * @ingroup ResourceLoader
  * @since 1.25
  */
 class ResourceLoaderImage {
@@ -337,6 +336,7 @@ class ResourceLoaderImage {
                // Reattach all direct children of the `<svg>` root node to the `<g>` wrapper
                while ( $root->firstChild ) {
                        $node = $root->firstChild;
+                       // @phan-suppress-next-line PhanUndeclaredProperty False positive
                        if ( !$titleNode && $node->nodeType === XML_ELEMENT_NODE && $node->tagName === 'title' ) {
                                // Remember the first encountered `<title>` node
                                $titleNode = $node;
@@ -437,7 +437,8 @@ class ResourceLoaderImage {
 
                        file_put_contents( $tempFilenameSvg, $svg );
 
-                       $metadata = SVGMetadataExtractor::getMetadata( $tempFilenameSvg );
+                       $svgReader = new SVGReader( $tempFilenameSvg );
+                       $metadata = $svgReader->getMetadata();
                        if ( !isset( $metadata['width'] ) || !isset( $metadata['height'] ) ) {
                                unlink( $tempFilenameSvg );
                                return false;