diff options
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 039c95648d..c656a1afd5 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -2512,29 +2512,17 @@ PHP_FUNCTION(domxml_node_replace_child) if (children == oldchild) { foundoldchild = 1; } - if(children == newchild) { - foundnewchild = 1; - } children = children->next; } /* if the child to replace is existent and the new child isn't already * a child, then do the replacement */ - if(foundoldchild && !foundnewchild) { + if(foundoldchild ) { zval *rv = NULL; xmlNodePtr node; node = xmlReplaceNode(oldchild, newchild); DOMXML_RET_OBJ(rv, oldchild, &ret); return; - } - /* If the new child is already a child, then DOM requires to delete - * the old one first, but this makes no sense here, since the old and - * the new node are identical. - */ - if(foundnewchild) { - zval *rv = NULL; - DOMXML_RET_OBJ(rv, newchild, &ret); - return; } else { RETURN_FALSE; } |