mirror of
https://github.com/getgrav/grav.git
synced 2026-03-22 12:31:36 +01:00
Fixed media crashing on a bad image
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
1. [](#bugfix)
|
||||
* Accessing page with unsupported file extension (jpg, pdf, xsl) will use wrong mime type [#3031](https://github.com/getgrav/grav/issues/3031)
|
||||
* Fixed media crashing on a bad image
|
||||
|
||||
# v1.7.0-rc.17
|
||||
## 10/07/2020
|
||||
|
||||
@@ -55,10 +55,11 @@ class ImageMedium extends Medium implements ImageMediaInterface, ImageManipulate
|
||||
|
||||
if (!($this->offsetExists('width') && $this->offsetExists('height') && $this->offsetExists('mime'))) {
|
||||
$image_info = getimagesize($path);
|
||||
|
||||
$this->def('width', $image_info[0]);
|
||||
$this->def('height', $image_info[1]);
|
||||
$this->def('mime', $image_info['mime']);
|
||||
if ($image_info) {
|
||||
$this->def('width', $image_info[0]);
|
||||
$this->def('height', $image_info[1]);
|
||||
$this->def('mime', $image_info['mime']);
|
||||
}
|
||||
}
|
||||
|
||||
$this->reset();
|
||||
|
||||
Reference in New Issue
Block a user