From 89da2476880beaf1ff3605f43192ba6d00ecf3d1 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 3 Sep 2021 12:29:31 +0300 Subject: [PATCH] fix(helpers): fix upload function image processing --- src/flextype/helpers/upload.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/flextype/helpers/upload.php b/src/flextype/helpers/upload.php index 125455c4..4a1e88d4 100644 --- a/src/flextype/helpers/upload.php +++ b/src/flextype/helpers/upload.php @@ -45,9 +45,12 @@ if (! function_exists('upload')) { try { $result->confirm(); - + // If upload file is image, do image file processing - if (isset($result->name)) { + if ($result->name) { + + $mediaFile = $uploadFolder . '/' . $result->name; + if (getimagesize($mediaFile)) { imageFile($mediaFile, $settings['process']['image']); }