Skip to content

Commit

Permalink
refactor: moved mimetypes to constant declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
buggyzap authored May 2, 2024
1 parent 75e6ddf commit 6484f57
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions ps_imageslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Ps_ImageSlider extends Module implements WidgetInterface
protected $default_pause_on_hover = 1;
protected $default_wrap = 1;
protected $templateFile;
const SUPPORTED_MIME_TYPES = ['jpg', 'gif', 'jpeg', 'png', 'avif', 'webp'];
/**
* @var string
*/
Expand Down Expand Up @@ -472,16 +473,9 @@ protected function _postProcess()
!empty($imagesize) &&
in_array(
Tools::strtolower(Tools::substr(strrchr($imagesize['mime'], '/'), 1)),
[
'jpg',
'gif',
'jpeg',
'png',
'avif',
'webp',
]
self::SUPPORTED_MIME_TYPES
) &&
in_array($type, ['jpg', 'gif', 'jpeg', 'png', 'avif', 'webp'])
in_array($type, self::SUPPORTED_MIME_TYPES)
) {
$temp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS');
$salt = sha1(microtime());
Expand Down

0 comments on commit 6484f57

Please sign in to comment.