Skip to content

Commit b2b41ec

Browse files
authored
Use getRemoteFileSize for image size check so that ssl verification follows config (#69)
1 parent 16378c1 commit b2b41ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Checks/Performance/ImageSizeCheck.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public function validateContent(Crawler $crawler): bool
6565
return true;
6666
}
6767

68-
$image = file_get_contents($url);
68+
$imageSize = getRemoteFileSize($url);
6969

70-
if (strlen($image) > 1000000) {
71-
$size = bytesToHumanReadable(strlen($image));
70+
if ($imageSize > 1000000) {
71+
$size = bytesToHumanReadable($imageSize);
7272

7373
$links[] = $url.' (size: '.$size.')';
7474

0 commit comments

Comments
 (0)