mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2025-01-05 23:40:41 +00:00
add check for allowed extension type (moved here from XMLManifest rules)
This commit is contained in:
parent
e5c59dc116
commit
31bb24d1dd
@ -50,6 +50,15 @@ class JedcheckerRulesXMLinfo extends JEDcheckerRule
|
|||||||
*/
|
*/
|
||||||
protected $description = 'COM_JEDCHECKER_INFO_XML_DESC';
|
protected $description = 'COM_JEDCHECKER_INFO_XML_DESC';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of JED extension types
|
||||||
|
*
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
protected $jedTypes = array(
|
||||||
|
'component', 'module', 'package', 'plugin'
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mapping of the plugin title prefix to the plugin group
|
* Mapping of the plugin title prefix to the plugin group
|
||||||
*
|
*
|
||||||
@ -146,6 +155,12 @@ class JedcheckerRulesXMLinfo extends JEDcheckerRule
|
|||||||
|
|
||||||
if ($isTopLevel)
|
if ($isTopLevel)
|
||||||
{
|
{
|
||||||
|
// JED allows components, modules, plugins, and packages (as a container) only
|
||||||
|
if (!in_array($type, $this->jedTypes, true))
|
||||||
|
{
|
||||||
|
$this->report->addError($file, JText::sprintf('COM_JEDCHECKER_MANIFEST_TYPE_NOT_ACCEPTED', $type));
|
||||||
|
}
|
||||||
|
|
||||||
// NM3 - Listing name contains “module” or “plugin”
|
// NM3 - Listing name contains “module” or “plugin”
|
||||||
// (and other reserved words)
|
// (and other reserved words)
|
||||||
if (preg_match('/\b(?:module|plugin|component|template|extension|free)\b/i', $extensionName, $match))
|
if (preg_match('/\b(?:module|plugin|component|template|extension|free)\b/i', $extensionName, $match))
|
||||||
|
Loading…
Reference in New Issue
Block a user