From: Michael Wallner Date: Tue, 4 Apr 2017 19:05:21 +0000 (+0200) Subject: fix #68 X-Git-Tag: RELEASE_3_2_0_RC1~49 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f019b225f947d2046f144d901d1b9a0585b4d5b6;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);