mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed ImageMedium constructor warning when file cannot be accessed
This commit is contained in:
parent
6daf480bfc
commit
610c6c341c
|
|
@ -7,6 +7,7 @@
|
|||
1. [](#bugfix)
|
||||
* Fixed a bug in `FormFlashFile::moveTo()` not deleting the old file
|
||||
* Fixed `FlexMediaTrait::getMedia()` trying to include uploaded but already moved media
|
||||
* Fixed `ImageMedium` constructor warning when file does not exist
|
||||
|
||||
# v1.6.0-beta.8
|
||||
## 01/25/2019
|
||||
|
|
|
|||
|
|
@ -83,11 +83,13 @@ class ImageMedium extends Medium
|
|||
|
||||
$config = Grav::instance()['config'];
|
||||
|
||||
if (filesize($this->get('filepath')) === 0) {
|
||||
$path = $this->get('filepath');
|
||||
if (!$path || !file_exists($path) || !filesize($path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$image_info = getimagesize($this->get('filepath'));
|
||||
$image_info = getimagesize($path);
|
||||
|
||||
$this->def('width', $image_info[0]);
|
||||
$this->def('height', $image_info[1]);
|
||||
$this->def('mime', $image_info['mime']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user