diff options
Diffstat (limited to 'ext/dom/php_dom.c')
-rw-r--r-- | ext/dom/php_dom.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 78d22f6a5e..351c138622 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1243,9 +1243,13 @@ int dom_hierarchy(xmlNodePtr parent, xmlNodePtr child) { xmlNodePtr nodep; - if (parent == NULL || child == NULL || child->doc != parent->doc) { - return SUCCESS; - } + if (parent == NULL || child == NULL || child->doc != parent->doc) { + return SUCCESS; + } + + if (child->type == XML_DOCUMENT_NODE) { + return FAILURE; + } nodep = parent; |