From ef4f34d223dfff6596546875ba4bf4129c004351 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 10 Dec 2019 11:35:08 -0800 Subject: [PATCH] Fixes #4017 - "Bad File Detected" when uppercase extension used on image. --- e107_handlers/file_class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php index ee334ec9c..b9c889832 100644 --- a/e107_handlers/file_class.php +++ b/e107_handlers/file_class.php @@ -1951,6 +1951,8 @@ class e_file // 1. Start by checking against filetypes - that's the easy one! $file_ext = pathinfo($target_name, PATHINFO_EXTENSION); + $file_ext = strtolower($file_ext); + // 2. For all files, read the first little bit to check for any flags etc $res = fopen($filename, 'rb'); $tstr = fread($res, 2048);