Skip to content

Commit

Permalink
Merge pull request #8592 from kenjis/fix-ErrorException-FileRules
Browse files Browse the repository at this point in the history
fix: [Validation] FileRules cause error if getimagesize() returns false
  • Loading branch information
kenjis authored Mar 5, 2024
2 parents efb3816 + e60466d commit 00c2ab9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion system/Validation/FileRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,13 @@ public function max_dims(?string $blank, string $params): bool
$allowedHeight = $params[1] ?? 0;

// Get uploaded image size
$info = getimagesize($file->getTempName());
$info = getimagesize($file->getTempName());

if ($info === false) {
// Cannot get the image size.
return false;
}

$fileWidth = $info[0];
$fileHeight = $info[1];

Expand Down

0 comments on commit 00c2ab9

Please sign in to comment.