Fix refcount on xpath iterators
xpath_query should return nodelist even when empty
return;
}
+ if (!source_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
+ RETURN_FALSE;
+ }
+
newdoc = dom_document_parser(id, mode, source TSRMLS_CC);
if (!newdoc)
}
if (!source_len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string supplied as input");
RETURN_FALSE;
}
zend_hash_move_forward(nodeht);
if (zend_hash_get_current_data(nodeht, (void **) &entry)==SUCCESS) {
curattr = *entry;
+ curattr->refcount++;
}
} else {
curnode = (xmlNodePtr)((php_libxml_node_ptr *)intern->ptr)->node;
zend_hash_internal_pointer_reset(nodeht);
if (zend_hash_get_current_data(nodeht, (void **) &entry)==SUCCESS) {
curattr = *entry;
+ curattr->refcount++;
}
} else {
nodep = (xmlNode *)dom_object_get_node(objmap->baseobj);
add_next_index_zval(retval, child);
}
} else {
- RETURN_FALSE;
+ retval = NULL;
}
php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);