From d3614818e3e6a27c174ee6f2cae7def18a36607c Mon Sep 17 00:00:00 2001 From: tynanbe Date: Tue, 19 Dec 2023 17:09:03 -0600 Subject: [PATCH] Fix an issue where getimagesize could cause page optimization to fail --- src/media.cls.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/media.cls.php b/src/media.cls.php index 8e41bf3e3..f0b4b7781 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -731,7 +731,11 @@ private function _detect_dimensions($src) $src = 'https:' . $src; } - $sizes = getimagesize($src); + try { + $sizes = getimagesize($src); + } catch (\Exception $e) { + return false; + } if (!empty($sizes[0]) && !empty($sizes[1])) { return $sizes;