From: Michael Wallner Date: Tue, 4 Apr 2017 19:05:21 +0000 (+0200) Subject: fix #68 X-Git-Tag: RELEASE_3_1_1_RC1~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d5d88f419c63a98f7cdef991e63f37b17f9ae413;p=m6w6%2Fext-http fix #68 --- diff --git a/src/php_http_client_request.c b/src/php_http_client_request.c index de7c0ff..71a9129 100644 --- a/src/php_http_client_request.c +++ b/src/php_http_client_request.c @@ -59,7 +59,12 @@ static PHP_METHOD(HttpClientRequest, __construct) PHP_HTTP_INFO(obj->message).request.method = estrndup(meth_str, meth_len); } if (zurl) { - PHP_HTTP_INFO(obj->message).request.url = php_http_url_from_zval(zurl, PHP_HTTP_URL_STDFLAGS); + php_http_url_t *url = php_http_url_from_zval(zurl, PHP_HTTP_URL_STDFLAGS); + + if (url) { + PHP_HTTP_INFO(obj->message).request.url = php_http_url_mod(url, NULL, PHP_HTTP_URL_STDFLAGS); + php_http_url_free(&url); + } } if (zheaders) { array_copy(Z_ARRVAL_P(zheaders), &obj->message->hdrs);