@@ -135,26 +135,24 @@ PHP_METHOD(DOMXPath, __construct)
135
135
}
136
136
137
137
intern = Z_XPATHOBJ_P (ZEND_THIS );
138
- if (intern != NULL ) {
139
- oldctx = (xmlXPathContextPtr )intern -> dom .ptr ;
140
- if (oldctx != NULL ) {
141
- php_libxml_decrement_doc_ref ((php_libxml_node_object * ) & intern -> dom );
142
- xmlXPathFreeContext (oldctx );
143
- }
144
-
145
- xmlXPathRegisterFuncNS (ctx , (const xmlChar * ) "functionString" ,
146
- (const xmlChar * ) "http://php.net/xpath" ,
147
- dom_xpath_ext_function_string_php );
148
- xmlXPathRegisterFuncNS (ctx , (const xmlChar * ) "function" ,
149
- (const xmlChar * ) "http://php.net/xpath" ,
150
- dom_xpath_ext_function_object_php );
151
-
152
- intern -> dom .ptr = ctx ;
153
- ctx -> userData = (void * )intern ;
154
- intern -> dom .document = docobj -> document ;
155
- intern -> register_node_ns = register_node_ns ;
156
- php_libxml_increment_doc_ref ((php_libxml_node_object * ) & intern -> dom , docp );
138
+ oldctx = (xmlXPathContextPtr )intern -> dom .ptr ;
139
+ if (oldctx != NULL ) {
140
+ php_libxml_decrement_doc_ref ((php_libxml_node_object * ) & intern -> dom );
141
+ xmlXPathFreeContext (oldctx );
157
142
}
143
+
144
+ xmlXPathRegisterFuncNS (ctx , (const xmlChar * ) "functionString" ,
145
+ (const xmlChar * ) "http://php.net/xpath" ,
146
+ dom_xpath_ext_function_string_php );
147
+ xmlXPathRegisterFuncNS (ctx , (const xmlChar * ) "function" ,
148
+ (const xmlChar * ) "http://php.net/xpath" ,
149
+ dom_xpath_ext_function_object_php );
150
+
151
+ intern -> dom .ptr = ctx ;
152
+ ctx -> userData = (void * )intern ;
153
+ intern -> dom .document = docobj -> document ;
154
+ intern -> register_node_ns = register_node_ns ;
155
+ php_libxml_increment_doc_ref ((php_libxml_node_object * ) & intern -> dom , docp );
158
156
}
159
157
/* }}} end DOMXPath::__construct */
160
158
0 commit comments