Open jerrywham opened 5 years ago
I guess $node should not be undefined. Can you provide a link to reproduce the problem ?
To be more generic I propose this fix:
public static function getNodesName($node, $name)
{
if (!isset($node->length)) {
return new DOMNodeList();
}
/* original function code */
}
If $node is not defined, getElementsByTagsName is undefined. I propose this fix