From ce01e699e3968ae2561430771c7041469551660a Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 9 Aug 2024 14:29:13 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1925 using something like PR #288 via @daun Co-authored-by: daun --- wire/core/Pageimage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/Pageimage.php b/wire/core/Pageimage.php index 2c84b2e3..d9f07274 100644 --- a/wire/core/Pageimage.php +++ b/wire/core/Pageimage.php @@ -543,8 +543,8 @@ class Pageimage extends Pagefile { if(!$filename) $filename = $this->filename; $xml = @file_get_contents($filename); - if($xml) { - $a = @simplexml_load_string($xml)->attributes(); + if($xml && false !== ($a = @simplexml_load_string($xml))) { + $a = $a->attributes(); if((int) $a->width > 0) $width = (int) $a->width; if((int) $a->height > 0) $height = (int) $a->height; if((!$width || !$height) && $a->viewBox) {