From b2b41ec058d8eb6e86b63a27ddecb5a7fee58425 Mon Sep 17 00:00:00 2001 From: Jaanus Vapper Date: Tue, 12 Nov 2024 12:49:28 +0200 Subject: [PATCH] Use getRemoteFileSize for image size check so that ssl verification follows config (#69) --- src/Checks/Performance/ImageSizeCheck.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Checks/Performance/ImageSizeCheck.php b/src/Checks/Performance/ImageSizeCheck.php index 8884f75..255099d 100644 --- a/src/Checks/Performance/ImageSizeCheck.php +++ b/src/Checks/Performance/ImageSizeCheck.php @@ -65,10 +65,10 @@ public function validateContent(Crawler $crawler): bool return true; } - $image = file_get_contents($url); + $imageSize = getRemoteFileSize($url); - if (strlen($image) > 1000000) { - $size = bytesToHumanReadable(strlen($image)); + if ($imageSize > 1000000) { + $size = bytesToHumanReadable($imageSize); $links[] = $url.' (size: '.$size.')';