31
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-05-30 20:30:47 +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']);
$object_file = new JObject($file);
$object_file->filepath = $filepath;
$file = (array) $object_file;
$file['filepath'] = $path . '/' . strtolower($file['name']);
// Let us try to upload
if (!JFile::upload($file['tmp_name'], $file['filepath'], false, true))
@ -192,11 +188,9 @@ class JedcheckerControllerUploads extends JControllerLegacy
{
if ($file->isFile())
{
$extension = pathinfo($file->getFilename(), PATHINFO_EXTENSION);
if ($extension === 'zip')
if (preg_match('/\.(?:zip|tar|tgz|tbz2|tar\.(?:gz|gzip|bz2|bzip2))$/', $file->getFilename(), $matches))
{
$unzip = $file->getPath() . '/' . $file->getBasename('.' . $extension);
$unzip = $file->getPath() . '/' . $file->getBasename($matches[0]);
try
{

View File

@ -367,7 +367,7 @@ class JedcheckerRulesXMLFiles extends JEDcheckerRule
}
// 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;
}