diff options
author | Benjamin Eberlei <kontakt@beberlei.de> | 2021-02-01 21:11:12 +0100 |
---|---|---|
committer | Benjamin Eberlei <kontakt@beberlei.de> | 2021-02-02 20:26:52 +0100 |
commit | 665e1f324a543bd04bcdd8dec089b82091c61671 (patch) | |
tree | faf5e1f09595b576c84cb3f61ebaf9a51aae1779 /ext/dom/parentnode.c | |
parent | 37ab72768f40fd028cc39ffb247c4416835b4001 (diff) | |
download | php-git-665e1f324a543bd04bcdd8dec089b82091c61671.tar.gz |
Fix bug #80600 DOMChildNode::remove does not work on DOMCharacterData.
Closes GH-6660
Diffstat (limited to 'ext/dom/parentnode.c')
-rw-r--r-- | ext/dom/parentnode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c index f47416edff..375c692dca 100644 --- a/ext/dom/parentnode.c +++ b/ext/dom/parentnode.c @@ -374,10 +374,6 @@ void dom_child_node_remove(dom_object *context) xmlNodePtr children; int stricterror; - if (dom_node_children_valid(child) == FAILURE) { - return; - } - stricterror = dom_get_strict_error(context->document); if (dom_node_is_read_only(child) == SUCCESS || @@ -391,6 +387,10 @@ void dom_child_node_remove(dom_object *context) return; } + if (dom_node_children_valid(child->parent) == FAILURE) { + return; + } + children = child->parent->children; if (!children) { php_dom_throw_error(NOT_FOUND_ERR, stricterror); |