From 6c50ba80c39d09798bc3250e9fdb5eced8f2c246 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sun, 31 Jan 2016 23:23:27 +0100 Subject: [PATCH] ResourceLoaderImage: Use DomDocument::loadXml rather than DomDocument::load Some users are reporting that DomDocument::load can't read the files on their setups, while they can be read with file_get_contents. So use that and pass the string to DomDocument::loadXml. The advantage of DomDocument::load is supposed to be in handling large files, and the icons here are supposed to be small. Bug: T107198 Change-Id: I8e4dc4642f9d0c5f01ec5e4061e83bf09d0a4900 --- includes/resourceloader/ResourceLoaderImage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/resourceloader/ResourceLoaderImage.php b/includes/resourceloader/ResourceLoaderImage.php index 9d5fe38d22..1f35e1fa89 100644 --- a/includes/resourceloader/ResourceLoaderImage.php +++ b/includes/resourceloader/ResourceLoaderImage.php @@ -272,7 +272,7 @@ class ResourceLoaderImage { */ protected function variantize( $variantConf, ResourceLoaderContext $context ) { $dom = new DomDocument; - $dom->load( $this->getPath( $context ) ); + $dom->loadXml( file_get_contents( $this->getPath( $context ) ) ); $root = $dom->documentElement; $wrapper = $dom->createElement( 'g' ); while ( $root->firstChild ) { -- 2.20.1