From 7a449d6743efa29902250349fa21bff8411dd5cf Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Mon, 16 Nov 2015 17:49:41 +0100 Subject: [PATCH 1/2] Change exif check to mime --- libraries/kunena/upload/upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/kunena/upload/upload.php b/libraries/kunena/upload/upload.php index 0ddfc0cdda1..ca311450d28 100644 --- a/libraries/kunena/upload/upload.php +++ b/libraries/kunena/upload/upload.php @@ -621,7 +621,7 @@ public function upload($fileInput, $destination, $type = 'attachment') } } - if (exif_imagetype($file->tmp_name)) + if (stripos($type, 'image/') !== false) { if (!$this->checkFileSizeImageAttachment($file->size)) { @@ -629,7 +629,7 @@ public function upload($fileInput, $destination, $type = 'attachment') } } - if (!exif_imagetype($file->tmp_name)) + if (stripos($type, 'image/') !== true) { if (!$this->checkFileSizeFileAttachment($file->size)) { From 04bbdb7227fa3de60821b21ed3565b7270df50d3 Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Mon, 16 Nov 2015 17:57:36 +0100 Subject: [PATCH 2/2] Update code --- libraries/kunena/upload/upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/kunena/upload/upload.php b/libraries/kunena/upload/upload.php index ca311450d28..f02c5d2a987 100644 --- a/libraries/kunena/upload/upload.php +++ b/libraries/kunena/upload/upload.php @@ -621,7 +621,7 @@ public function upload($fileInput, $destination, $type = 'attachment') } } - if (stripos($type, 'image/') !== false) + if (!$file->isAvatar && stripos($type, 'image/') !== false) { if (!$this->checkFileSizeImageAttachment($file->size)) { @@ -629,7 +629,7 @@ public function upload($fileInput, $destination, $type = 'attachment') } } - if (stripos($type, 'image/') !== true) + if (!$file->isAvatar && stripos($type, 'image/') !== true) { if (!$this->checkFileSizeFileAttachment($file->size)) {