31
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-06-09 00:32:19 +00:00

switch to JEDCheckerHelper::findManifests in the XMLlicense rule

This commit is contained in:
Denis Ryabov 2021-05-11 20:52:36 +03:00
parent 21faa210dc
commit 7949ee3872

View File

@ -15,6 +15,9 @@ defined('_JEXEC') or die('Restricted access');
// Include the rule base class
require_once JPATH_COMPONENT_ADMINISTRATOR . '/models/rule.php';
// Include the helper class
require_once JPATH_COMPONENT_ADMINISTRATOR . '/libraries/helper.php';
/**
* class JedcheckerRulesXMLlicense
*
@ -53,7 +56,7 @@ class JedcheckerRulesXMLlicense extends JEDcheckerRule
public function check()
{
// Find all XML files of the extension
$files = JFolder::files($this->basedir, '\.xml$', true, true);
$files = JEDCheckerHelper::findManifests($this->basedir);
// Iterate through all the xml files
foreach ($files as $file)
@ -81,13 +84,6 @@ class JedcheckerRulesXMLlicense extends JEDcheckerRule
return true;
}
// Check if this is an extension manifest
// 1.5 uses 'install', 1.6 uses 'extension'
if ($xml->getName() != 'install' && $xml->getName() != 'extension')
{
return true;
}
// Check if there's a license tag
if (!isset($xml->license))
{