From e30e3d3290cc293741ac031bde4f9163715f8e82 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 27 Nov 2018 21:40:48 +0700 Subject: [PATCH] add extension_loaded(imagick) and class_exists(Imagick) check at ImageMagickHandler --- system/Images/Handlers/ImageMagickHandler.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/Images/Handlers/ImageMagickHandler.php b/system/Images/Handlers/ImageMagickHandler.php index 5d5e7cd67933..759316e8178b 100644 --- a/system/Images/Handlers/ImageMagickHandler.php +++ b/system/Images/Handlers/ImageMagickHandler.php @@ -69,6 +69,14 @@ class ImageMagickHandler extends BaseHandler public function __construct($config = null) { parent::__construct($config); + + // We should never see this, so can't test it + // @codeCoverageIgnoreStart + if (! (extension_loaded('imagick') || class_exists('Imagick'))) + { + throw ImageException::forMissingExtension('IMAGICK'); + } + // @codeCoverageIgnoreEnd } //--------------------------------------------------------------------