Skip to content

Commit

Permalink
Use getRemoteFileSize for image size check so that ssl verification f…
Browse files Browse the repository at this point in the history
…ollows config (#69)
  • Loading branch information
hulkur authored Nov 12, 2024
1 parent 16378c1 commit b2b41ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Checks/Performance/ImageSizeCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.')';

Expand Down

0 comments on commit b2b41ec

Please sign in to comment.