|
|
|
@ -1480,6 +1480,7 @@ class Readability implements LoggerAwareInterface |
|
|
|
$childNodes = iterator_to_array($node->childNodes); |
|
|
|
$childNodes = iterator_to_array($node->childNodes); |
|
|
|
$children = array_filter($childNodes, fn ($childNode) => $childNode instanceof \DOMElement); |
|
|
|
$children = array_filter($childNodes, fn ($childNode) => $childNode instanceof \DOMElement); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$children = array_values($children); |
|
|
|
// There should be exactly 1 element child with given tag |
|
|
|
// There should be exactly 1 element child with given tag |
|
|
|
if (1 !== \count($children) || $children[0]->nodeName !== $tag) { |
|
|
|
if (1 !== \count($children) || $children[0]->nodeName !== $tag) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|