fix old and add new http\Client\Curl\Versions constants
[m6w6/ext-http] / src / php_http_url.c
index 2055df7a33890724162dd292e4f085f06e071ee6..21e38e248be4d2355ba5167f5ebc9ee61d1dc712 100644 (file)
@@ -535,7 +535,7 @@ HashTable *php_http_url_to_struct(const php_http_url_t *url, zval *strct)
        if (!strct || Z_TYPE_P(strct) == IS_ARRAY) { \
                zend_hash_str_update(ht, part, lenof(part), &tmp); \
        } else { \
-               zend_update_property(Z_OBJCE_P(strct), strct, part, lenof(part), &tmp); \
+               zend_update_property(Z_OBJCE_P(strct), Z_OBJ_P(strct), part, lenof(part), &tmp); \
                zval_ptr_dtor(&tmp); \
        }
 
@@ -1021,7 +1021,7 @@ static ZEND_RESULT_CODE parse_uidn_2003(struct parse_state *state, size_t prev_l
 #      endif
 
        efree(uhost_str);
-       if (error > U_ZERO_ERROR) {
+       if (rc > U_ZERO_ERROR) {
                goto error;
        }
 
@@ -1984,7 +1984,7 @@ PHP_METHOD(HttpUrl, mod)
                if ((old_purl = php_http_url_from_struct(HASH_OF(getThis())))) {
                        php_http_url_t *res_purl;
 
-                       ZVAL_OBJ(return_value, zend_objects_clone_obj(getThis()));
+                       ZVAL_OBJ(return_value, zend_objects_clone_obj(Z_OBJ_P(getThis())));
 
                        res_purl = php_http_url_mod(old_purl, new_purl, flags);
                        php_http_url_to_struct(res_purl, return_value);
@@ -2088,14 +2088,14 @@ PHP_MINIT_FUNCTION(http_url)
 #endif
        zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_TOPCT"), PHP_HTTP_URL_PARSE_TOPCT);
 
-       INIT_NS_CLASS_ENTRY(ce, "http\\Env", "Url", php_http_url_methods);
-       php_http_env_url_class_entry = zend_register_internal_class_ex(&ce, php_http_url_class_entry);
-
        zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("IGNORE_ERRORS"), PHP_HTTP_URL_IGNORE_ERRORS);
        zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("SILENT_ERRORS"), PHP_HTTP_URL_SILENT_ERRORS);
 
        zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("STDFLAGS"), PHP_HTTP_URL_STDFLAGS);
 
+       INIT_NS_CLASS_ENTRY(ce, "http\\Env", "Url", NULL);
+       php_http_env_url_class_entry = zend_register_internal_class_ex(&ce, php_http_url_class_entry);
+
        return SUCCESS;
 }