33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-30 16:53:59 +00:00

Merge PR #168 into develop

This commit is contained in:
Llewellyn van der Merwe 2021-12-05 19:48:40 +02:00
commit ae692bf3ea
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
2 changed files with 4 additions and 10 deletions

View File

@ -85,11 +85,7 @@ class JedcheckerControllerUploads extends JControllerLegacy
} }
} }
$filepath = $path . '/' . strtolower($file['name']); $file['filepath'] = $path . '/' . strtolower($file['name']);
$object_file = new JObject($file);
$object_file->filepath = $filepath;
$file = (array) $object_file;
// Let us try to upload // Let us try to upload
if (!JFile::upload($file['tmp_name'], $file['filepath'], false, true)) if (!JFile::upload($file['tmp_name'], $file['filepath'], false, true))
@ -192,11 +188,9 @@ class JedcheckerControllerUploads extends JControllerLegacy
{ {
if ($file->isFile()) if ($file->isFile())
{ {
$extension = pathinfo($file->getFilename(), PATHINFO_EXTENSION); if (preg_match('/\.(?:zip|tar|tgz|tbz2|tar\.(?:gz|gzip|bz2|bzip2))$/', $file->getFilename(), $matches))
if ($extension === 'zip')
{ {
$unzip = $file->getPath() . '/' . $file->getBasename('.' . $extension); $unzip = $file->getPath() . '/' . $file->getBasename($matches[0]);
try try
{ {

View File

@ -367,7 +367,7 @@ class JedcheckerRulesXMLFiles extends JEDcheckerRule
} }
// Extra check for unzipped files // Extra check for unzipped files
if (preg_match('/^(.*)\.(zip|tgz|tar\.gz)$/', $filename, $matches) && is_dir($matches[1])) if (preg_match('/^(.*)\.(?:zip|tar|tgz|tbz2|tar\.(?:gz|gzip|bz2|bzip2))$/', $filename, $matches) && is_dir($matches[1]))
{ {
continue; continue;
} }