mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix compat with libcurl 7.56.1+ and file:// wrapper
This commit is contained in:
commit
36f85e17e2
@ -219,6 +219,17 @@ static int php_curl_option_url(php_curl *ch, const char *url, const size_t len)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if LIBCURL_VERSION_NUM > 0x073800 && defined(PHP_WIN32)
|
||||
if (len > sizeof("file://") - 1 && '/' != url[sizeof("file://") - 1] && !strncmp("file://", url, sizeof("file://") - 1) && len < MAXPATHLEN - 2) {
|
||||
char _tmp[MAXPATHLEN] = {0};
|
||||
|
||||
memmove(_tmp, "file:///", sizeof("file:///") - 1);
|
||||
memmove(_tmp + sizeof("file:///") - 1, url + sizeof("file://") - 1, len - sizeof("file://") + 1);
|
||||
|
||||
return php_curl_option_str(ch, CURLOPT_URL, _tmp, len + 1, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
return php_curl_option_str(ch, CURLOPT_URL, url, len, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user