Skip to content

Commit fed1d5e

Browse files
committed
Add extra test for stale entity references
1 parent 6f989cd commit fed1d5e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--TEST--
2+
Entity references with stale entity declaration 03
3+
--EXTENSIONS--
4+
dom
5+
--FILE--
6+
<?php
7+
8+
foreach (['firstChild', 'lastChild', 'textContent', 'childNodes'] as $prop) {
9+
$dom = DOM\XMLDocument::createFromString(<<<XML
10+
<!DOCTYPE foo [
11+
<!ENTITY foo "bar">
12+
]>
13+
<foo>&foo;</foo>
14+
XML);
15+
16+
$ref = $dom->documentElement->firstChild;
17+
$decl = $ref->firstChild;
18+
19+
$nodes = $ref->childNodes;
20+
$dom->removeChild($dom->doctype);
21+
unset($decl);
22+
23+
var_dump($ref->$prop);
24+
}
25+
26+
?>
27+
--EXPECT--
28+
NULL
29+
NULL
30+
NULL
31+
object(DOM\NodeList)#1 (1) {
32+
["length"]=>
33+
int(0)
34+
}

0 commit comments

Comments
 (0)