php_url *purl, furl = {NULL};
size_t full_len = 0;
zval *zhost = NULL;
- char *scheme = NULL, *URL = ecalloc(1, HTTP_URI_MAXLEN + 1);
+ char *scheme = NULL, *uri, *URL = ecalloc(1, HTTP_URI_MAXLEN + 1);
if ((!url || !url_len) && (
(!(url = SG(request_info).request_uri)) ||
return NULL;
}
- if (!(purl = php_url_parse((char *) url))) {
+ uri = estrndup(url, url_len);
+ if (!(purl = php_url_parse(uri))) {
http_error_ex(E_WARNING, HTTP_E_PARSE, "Could not parse supplied URL: %s", url);
return NULL;
}
efree(scheme); \
} \
php_url_free(purl); \
+ efree(uri); \
return URL; \
} else { \
strcat(URL, add_string); \
efree(scheme);
}
php_url_free(purl);
+ efree(uri);
return URL;
}