Skip to content

Commit

Permalink
Merge pull request #607 from tynanbe/catch_getimagesize
Browse files Browse the repository at this point in the history
Fix an issue where getimagesize could cause page optimization to fail
  • Loading branch information
hi-hai authored Jan 2, 2024
2 parents 342968f + d361481 commit 857adfb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/media.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 857adfb

Please sign in to comment.