mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
This worked for non-parsed elements already, but not for elements where xmlAddID() returns early due to the ID already existing. In that case what was missing is marking the attribute as an ID. Closes GH-20283.
16 lines
346 B
PHP
16 lines
346 B
PHP
--TEST--
|
|
GH-20281 (\Dom\Document::getElementById() is inconsistent after nodes are removed)
|
|
--EXTENSIONS--
|
|
dom
|
|
--CREDITS--
|
|
cscott
|
|
--FILE--
|
|
<?php
|
|
$d = \Dom\HTMLDocument::createFromString('<p id="a">b</p><p id="a">c</p>', LIBXML_NOERROR);
|
|
$p = $d->getElementById('a');
|
|
$p->remove();
|
|
echo $d->getElementById('a')->textContent, "\n";
|
|
?>
|
|
--EXPECT--
|
|
c
|