33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2025-01-03 22:57:21 +00:00

add support of any attribute (by using '*' as value)

This commit is contained in:
Denis Ryabov 2021-02-24 00:32:28 +03:00
parent 62a887092c
commit f7353bf312

View File

@ -171,14 +171,19 @@ class JedcheckerRulesXMLManifest extends JEDcheckerRule
{ {
// Check attributes // Check attributes
$DTDattributes = isset($this->DTDAttrRules[$name]) ? $this->DTDAttrRules[$name] : array(); $DTDattributes = isset($this->DTDAttrRules[$name]) ? $this->DTDAttrRules[$name] : array();
if (isset($DTDattributes[0]) && $DTDattributes[0] !== '*')
{
foreach ($node->attributes() as $attr) foreach ($node->attributes() as $attr)
{ {
$attr_name = (string)$attr->getName(); $attr_name = (string)$attr->getName();
if (!in_array($attr_name, $DTDattributes, true)) if (!in_array($attr_name, $DTDattributes, true))
{ {
$this->warnings[] = JText::sprintf('COM_JEDCHECKER_MANIFEST_UNKNOWN_ATTRIBUTE', $name, $attr_name); $this->warnings[] = JText::sprintf('COM_JEDCHECKER_MANIFEST_UNKNOWN_ATTRIBUTE', $name, $attr_name);
} }
} }
}
// Check children nodes // Check children nodes
if (!isset($this->DTDNodeRules[$name])) if (!isset($this->DTDNodeRules[$name]))