From 5bab76e834271ae800b1495e44841d4c8e6e12b0 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Thu, 18 Feb 2021 15:20:00 +0300 Subject: [PATCH] don't warn on missed unzipped files (in packages) --- .../com_jedchecker/libraries/rules/xmlfiles.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_jedchecker/libraries/rules/xmlfiles.php b/administrator/components/com_jedchecker/libraries/rules/xmlfiles.php index 7c6d0a6..ad15c4e 100644 --- a/administrator/components/com_jedchecker/libraries/rules/xmlfiles.php +++ b/administrator/components/com_jedchecker/libraries/rules/xmlfiles.php @@ -202,10 +202,17 @@ class JedcheckerRulesXMLFiles extends JEDcheckerRule { foreach ($files as $file) { - if (!is_file($dir . $file)) + $filename = $dir . $file; + if (is_file($filename)) { - $this->errors[] = JText::sprintf('COM_JEDCHECKER_XML_FILES_FILE_NOT_FOUND', (string)$file); + continue; } + // extra check for unzipped files + if (preg_match('/^(.*)\.(zip|tar\.gz)$/', $filename, $matches) && is_dir($matches[1])) + { + continue; + } + $this->errors[] = JText::sprintf('COM_JEDCHECKER_XML_FILES_FILE_NOT_FOUND', (string)$file); } }