mirror of
https://github.com/php/php-src.git
synced 2026-04-26 17:38:14 +02:00
@ - DomNode->child_nodes() returns empty array instead of false, if no
@ - child nodes are found (chregu)
This commit is contained in:
@@ -2258,19 +2258,18 @@ PHP_FUNCTION(domxml_node_children)
|
||||
last = ((xmlDoc *) nodep)->children;
|
||||
else
|
||||
last = nodep->children;
|
||||
if (!last) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
while (last) {
|
||||
zval *child;
|
||||
child = php_domobject_new(last, &ret, NULL TSRMLS_CC);
|
||||
add_next_index_zval(return_value, child);
|
||||
last = last->next;
|
||||
|
||||
if (last) {
|
||||
while (last) {
|
||||
zval *child;
|
||||
child = php_domobject_new(last, &ret, NULL TSRMLS_CC);
|
||||
add_next_index_zval(return_value, child);
|
||||
last = last->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
Reference in New Issue
Block a user