diff options
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r-- | ext/curl/interface.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 53c8c76f4f..1ada79b850 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -638,7 +638,6 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLOPT_BUFFERSIZE); REGISTER_CURL_CONSTANT(CURLOPT_CAINFO); REGISTER_CURL_CONSTANT(CURLOPT_CAPATH); - REGISTER_CURL_CONSTANT(CURLOPT_CLOSEPOLICY); REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT); REGISTER_CURL_CONSTANT(CURLOPT_COOKIE); REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE); @@ -728,13 +727,6 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION); REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER); - /* Constants effecting the way CURLOPT_CLOSEPOLICY works */ - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_CALLBACK); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_OLDEST); - REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_SLOWEST); - /* */ REGISTER_CURL_CONSTANT(CURLE_ABORTED_BY_CALLBACK); REGISTER_CURL_CONSTANT(CURLE_BAD_CALLING_ORDER); @@ -1830,7 +1822,7 @@ static void alloc_curl_handle(php_curl **ch) zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0); zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0); - (*ch)->safe_upload = 0; /* for now, for BC reason we allow unsafe API */ + (*ch)->safe_upload = 1; /* for now, for BC reason we allow unsafe API */ (*ch)->to_free->slist = emalloc(sizeof(HashTable)); zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0); @@ -1934,7 +1926,10 @@ static void _php_curl_set_default_options(php_curl *ch) curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120); curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ - cainfo = INI_STR("curl.cainfo"); + cainfo = INI_STR("openssl.cafile"); + if (!(cainfo && strlen(cainfo) > 0)) { + cainfo = INI_STR("curl.cainfo"); + } if (cainfo && strlen(cainfo) > 0) { curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo); } @@ -2115,7 +2110,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC) } case CURLOPT_AUTOREFERER: case CURLOPT_BUFFERSIZE: - case CURLOPT_CLOSEPOLICY: case CURLOPT_CONNECTTIMEOUT: case CURLOPT_COOKIESESSION: case CURLOPT_CRLF: @@ -2562,12 +2556,14 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC) case CURLOPT_FOLLOWLOCATION: convert_to_long_ex(zvalue); +#if LIBCURL_VERSION_NUM < 0x071304 if (PG(open_basedir) && *PG(open_basedir)) { if (Z_LVAL_PP(zvalue) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"); return FAILURE; } } +#endif error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; |