From 6ec829e47f1996414c8b24f5649e5bcd68953809 Mon Sep 17 00:00:00 2001 From: slawkens1 Date: Wed, 11 Oct 2017 22:22:12 +0200 Subject: [PATCH] * fixed if plugin zip file name contains dot (.) --- system/pages/admin/plugins.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/pages/admin/plugins.php b/system/pages/admin/plugins.php index 143b04e7..b5c48f72 100644 --- a/system/pages/admin/plugins.php +++ b/system/pages/admin/plugins.php @@ -108,10 +108,12 @@ else if(isset($_FILES["plugin"]["name"])) } else { if(is_uploaded_file($file['tmp_name']) ) { - if(strtolower($name[1]) == 'zip') // check if it is zipped/compressed file + $filetype = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); + if($filetype == 'zip') // check if it is zipped/compressed file { + $tmp_filename = pathinfo($filename, PATHINFO_FILENAME); $targetdir = BASE; - $targetzip = BASE . 'plugins/' . $name[0] . '.zip'; + $targetzip = BASE . 'plugins/' . $tmp_filename; if(move_uploaded_file($tmp_name, $targetzip)) { // move uploaded file $zip = new ZipArchive();