php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #75862
Patch ext_curl_interface_c-7.3.patch revision 2021-10-23 16:47 UTC by dpa-bugs at aegee dot org

Patch ext_curl_interface_c-7.3.patch for cURL related Bug #75862

Patch version 2021-10-23 16:47 UTC

Return to Bug #75862 | Download this patch
Patch Revisions:

Developer: dpa-bugs@aegee.org

--- ext/curl/interface.c.orig	2019-12-17 10:29:16.000000000 +0000
+++ ext/curl/interface.c	2019-12-28 18:01:29.844958951 +0000
@@ -2003,6 +2003,9 @@
 #endif
 	curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
 	curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
+#if !ENABLE_IPV6 && LIBCURL_VERSION_NUM >= 0x070a08 /* 7.10.8 */
+	curl_easy_setopt(ch->cp, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+#endif
 
 	cainfo = INI_STR("openssl.cafile");
 	if (!(cainfo && cainfo[0] != '\0')) {
@@ -2363,6 +2366,12 @@
 		case CURLOPT_DISALLOW_USERNAME_IN_URL:
 #endif
 			lval = zval_get_long(zvalue);
+#if !ENABLE_IPV6 && LIBCURL_VERSION_NUM >= 0x070a08 /* Available since 7.10.8 */
+			if (option == CURLOPT_IPRESOLVE && lval == CURL_IPRESOLVE_V6) {
+					php_error_docref(NULL, E_WARNING, "CURL_IPRESOLVE_V6 cannot be activated as php is compiled without IPv6 support");
+					return 1;
+			}
+#endif
 #if LIBCURL_VERSION_NUM >= 0x071304
 			if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
 				(PG(open_basedir) && *PG(open_basedir)) && (lval & CURLPROTO_FILE)) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 14:01:29 2024 UTC