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:
commit
ae692bf3ea
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user