1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Remove always-true check

This commit is contained in:
Niels Dossche
2024-02-22 23:39:18 +01:00
parent 171e3986b0
commit 9c2c0c3d02

View File

@@ -135,26 +135,24 @@ PHP_METHOD(DOMXPath, __construct)
}
intern = Z_XPATHOBJ_P(ZEND_THIS);
if (intern != NULL) {
oldctx = (xmlXPathContextPtr)intern->dom.ptr;
if (oldctx != NULL) {
php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
xmlXPathFreeContext(oldctx);
}
xmlXPathRegisterFuncNS (ctx, (const xmlChar *) "functionString",
(const xmlChar *) "http://php.net/xpath",
dom_xpath_ext_function_string_php);
xmlXPathRegisterFuncNS (ctx, (const xmlChar *) "function",
(const xmlChar *) "http://php.net/xpath",
dom_xpath_ext_function_object_php);
intern->dom.ptr = ctx;
ctx->userData = (void *)intern;
intern->dom.document = docobj->document;
intern->register_node_ns = register_node_ns;
php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp);
oldctx = (xmlXPathContextPtr)intern->dom.ptr;
if (oldctx != NULL) {
php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
xmlXPathFreeContext(oldctx);
}
xmlXPathRegisterFuncNS (ctx, (const xmlChar *) "functionString",
(const xmlChar *) "http://php.net/xpath",
dom_xpath_ext_function_string_php);
xmlXPathRegisterFuncNS (ctx, (const xmlChar *) "function",
(const xmlChar *) "http://php.net/xpath",
dom_xpath_ext_function_object_php);
intern->dom.ptr = ctx;
ctx->userData = (void *)intern;
intern->dom.document = docobj->document;
intern->register_node_ns = register_node_ns;
php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp);
}
/* }}} end DOMXPath::__construct */