mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: ErrorException is thrown if getimagesize() returns false
ErrorException Trying to access array offset on value of type bool
This commit is contained in:
parent
9894b92997
commit
e60466dabc
@ -243,6 +243,12 @@ class FileRules
|
||||
|
||||
// Get uploaded image size
|
||||
$info = getimagesize($file->getTempName());
|
||||
|
||||
if ($info === false) {
|
||||
// Cannot get the image size.
|
||||
return false;
|
||||
}
|
||||
|
||||
$fileWidth = $info[0];
|
||||
$fileHeight = $info[1];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user