mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +00:00
Avoid adding id that might already exists
We append a new node when it isn't a `div` or `p` (like when it's an `article`) with the same id which generate a DOM error "DOMElement::setAttribute(): ID blabla already defined".
This commit is contained in:
@@ -951,10 +951,6 @@ class Readability
|
||||
$nodeToAppend = $this->dom->createElement('div');
|
||||
|
||||
try {
|
||||
if ($siblingNode->getAttribute('id')) {
|
||||
$nodeToAppend->setAttribute('id', $siblingNode->getAttribute('id'));
|
||||
}
|
||||
|
||||
$nodeToAppend->setAttribute('alt', $siblingNodeName);
|
||||
$nodeToAppend->innerHTML = $siblingNode->innerHTML;
|
||||
} catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user