X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_functions.c;h=5cb8a16a400c5cb5d3590c6171b838ed4e56243b;hp=f7ecd7af76f8b087e237c0e170db9d0c8a1f7eae;hb=f9d92cff35589f414e369228502c91f35a4e3643;hpb=ba74942b44bb39de8a028a56524db5a3c37363d5 diff --git a/http_functions.c b/http_functions.c index f7ecd7a..5cb8a16 100644 --- a/http_functions.c +++ b/http_functions.c @@ -79,7 +79,7 @@ PHP_FUNCTION(http_date) * If a port is pecified in either the url or as sperate parameter, * it will be added if it differs from te default port for HTTP(S). * - * Returns the absolute URI as string. + * Returns the absolute URI as string on success or false on failure. * * Examples: *
@@ -90,7 +90,7 @@ PHP_FUNCTION(http_date) */ PHP_FUNCTION(http_build_uri) { - char *url = NULL, *proto = NULL, *host = NULL; + char *url = NULL, *proto = NULL, *host = NULL, *built = NULL; int url_len = 0, proto_len = 0, host_len = 0; long port = 0; @@ -98,7 +98,10 @@ PHP_FUNCTION(http_build_uri) RETURN_FALSE; } - RETURN_STRING(http_absolute_uri_ex(url, url_len, proto, proto_len, host, host_len, port), 0); + if ((built = http_absolute_uri_ex(url, url_len, proto, proto_len, host, host_len, port))) { + RETURN_STRING(built, 0); + } + RETURN_FALSE; } /* }}} */