#include "php_http_api.h"
#include "php_http_url_api.h"
-ZEND_EXTERN_MODULE_GLOBALS(http);
-
PHP_HTTP_API char *_http_absolute_url(const char *url TSRMLS_DC)
{
char *abs = estrdup(url);
if (purl) {
http_build_url(purl, NULL, NULL, &abs, NULL);
php_url_free(purl);
+ } else {
+ http_error_ex(HE_WARNING, HTTP_E_URL, "Could not parse URL (%s)", url);
}
return abs;
return FAILURE;
}
} else {
- zval *val;
-
- ALLOC_ZVAL(val);
- *val = **data;
- INIT_PZVAL(val);
- zval_copy_ctor(val);
- convert_to_string(val);
+ zval *val = zval_copy(IS_STRING, *data);
if (PHPSTR_LEN(str)) {
phpstr_append(str, arg_sep, arg_sep_len);
efree(encoded_val);
}
- zval_ptr_dtor(&val);
+ zval_free(&val);
}
phpstr_dtor(&new_prefix);
}