From 451b73c2ef0d064e927bd383f4bafc214e371ebe Mon Sep 17 00:00:00 2001 From: MartyIX <vseticka.martin@gmail.com> Date: Sat, 22 Mar 2014 21:53:03 +0100 Subject: [PATCH] Update class.osticket.php There are extensions such as "7z" and "gz" that are valid. --- include/class.osticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/class.osticket.php b/include/class.osticket.php index 98979448c..abd563839 100644 --- a/include/class.osticket.php +++ b/include/class.osticket.php @@ -144,7 +144,7 @@ class osTicket { $allowed = array_map('trim', explode(',', strtolower($allowedFileTypes))); $filename = is_array($file)?$file['name']:$file; - $ext = strtolower(preg_replace("/.*\.(.{3,4})$/", "$1", $filename)); + $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); //TODO: Check MIME type - file ext. shouldn't be solely trusted. -- GitLab