summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS20
-rw-r--r--ext/curl/interface.c268
-rw-r--r--ext/curl/tests/curl_setopt_basic003.phpt2
3 files changed, 266 insertions, 24 deletions
diff --git a/NEWS b/NEWS
index 7028faf..15c3ff6 100644
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,25 @@ PHP NEWS
- General improvements:
. World domination
-- Curl:
+- cURL:
+ . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND,
+ CURLOPT_DIRLISTONLY, CURLOPT_NEW_DIRECTORY_PERMS, CURLOPT_NEW_FILE_PERMS,
+ CURLOPT_NETRC_FILE, CURLOPT_PREQUOTE, CURLOPT_KRBLEVEL, CURLOPT_MAXFILESIZE,
+ CURLOPT_FTP_ACCOUNT, CURLOPT_COOKIELIST, CURLOPT_IGNORE_CONTENT_LENGTH,
+ CURLOPT_CONNECT_ONLY, CURLOPT_LOCALPORT, CURLOPT_LOCALPORTRANGE,
+ CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPT_SSL_SESSIONID_CACHE,
+ CURLOPT_FTP_SSL_CCC, CURLOPT_HTTP_CONTENT_DECODING,
+ CURLOPT_HTTP_TRANSFER_DECODING, CURLOPT_PROXY_TRANSFER_MODE,
+ CURLOPT_ADDRESS_SCOPE, CURLOPT_CRLFILE, CURLOPT_ISSUERCERT,
+ CURLOPT_USERNAME, CURLOPT_PASSWORD, CURLOPT_PROXYUSERNAME,
+ CURLOPT_PROXYPASSWORD, CURLOPT_NOPROXY, CURLOPT_SOCKS5_GSSAPI_NEC,
+ CURLOPT_SOCKS5_GSSAPI_SERVICE, CURLOPT_TFTP_BLKSIZE,
+ CURLOPT_SSH_KNOWNHOSTS, CURLOPT_FTP_USE_PRET, CURLOPT_MAIL_FROM,
+ CURLOPT_MAIL_RCPT, CURLOPT_RTSP_CLIENT_CSEQ, CURLOPT_RTSP_SERVER_CSEQ,
+ CURLOPT_RTSP_SESSION_ID, CURLOPT_RTSP_STREAM_URI, CURLOPT_RTSP_TRANSPORT,
+ CURLOPT_RTSP_REQUEST, CURLOPT_RESOLVE, CURLOPT_ACCEPT_ENCODING,
+ CURLOPT_TRANSFER_ENCODING, CURLOPT_DNS_SERVERS and CURLOPT_USE_SSL.
+ (Pierrick)
. Fixed bug #55635 (CURLOPT_BINARYTRANSFER no longer used. The constant
still exists for backward compatibility but is doing nothing). (Pierrick)
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 4de678e..c51b01d 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -535,11 +535,12 @@ PHP_MINIT_FUNCTION(curl)
of options and which version they were introduced */
/* Constants for curl_setopt() */
-#if LIBCURL_VERSION_NUM > 0x070a07 /* CURLOPT_IPRESOLVE is available since curl 7.10.8 */
+#if LIBCURL_VERSION_NUM > 0x070a07 /* CURLOPT_IPRESOLVE and CURLOPT_FTP_RESPONSE_TIMEOUT are available since curl 7.10.8 */
REGISTER_CURL_CONSTANT(CURLOPT_IPRESOLVE);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_WHATEVER);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V4);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V6);
+ REGISTER_CURL_CONSTANT(CURLOPT_FTP_RESPONSE_TIMEOUT);
#endif
REGISTER_CURL_CONSTANT(CURLOPT_DNS_USE_GLOBAL_CACHE);
REGISTER_CURL_CONSTANT(CURLOPT_DNS_CACHE_TIMEOUT);
@@ -561,7 +562,16 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_POST);
REGISTER_CURL_CONSTANT(CURLOPT_FTPLISTONLY);
REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND);
+#if LIBCURL_VERSION_NUM >= 0x071100 /* Available since 7.17.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_APPEND);
+ REGISTER_CURL_CONSTANT(CURLOPT_DIRLISTONLY);
+ REGISTER_CURL_CONSTANT(CURLOPT_NEW_DIRECTORY_PERMS);
+ REGISTER_CURL_CONSTANT(CURLOPT_NEW_FILE_PERMS);
+#endif
REGISTER_CURL_CONSTANT(CURLOPT_NETRC);
+#if LIBCURL_VERSION_NUM >= 0x070b00 /* Option available since 7.11.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_NETRC_FILE);
+#endif
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
#if CURLOPT_FTPASCII != 0
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
@@ -602,8 +612,14 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_RETURNTRANSFER);
REGISTER_CURL_CONSTANT(CURLOPT_QUOTE);
REGISTER_CURL_CONSTANT(CURLOPT_POSTQUOTE);
+#if LIBCURL_VERSION_NUM >= 0x070905 /* Available since 7.9.5 */
+ REGISTER_CURL_CONSTANT(CURLOPT_PREQUOTE);
+#endif
REGISTER_CURL_CONSTANT(CURLOPT_INTERFACE);
REGISTER_CURL_CONSTANT(CURLOPT_KRB4LEVEL);
+#if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */
+ REGISTER_CURL_CONSTANT(CURLOPT_KRBLEVEL);
+#endif
REGISTER_CURL_CONSTANT(CURLOPT_HTTPPROXYTUNNEL);
REGISTER_CURL_CONSTANT(CURLOPT_FILETIME);
REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION);
@@ -675,7 +691,93 @@ PHP_MINIT_FUNCTION(curl)
#endif
REGISTER_CURL_CONSTANT(CURLOPT_PRIVATE);
-
+#if LIBCURL_VERSION_NUM >= 0x070a08 /* Available since 7.10.8 */
+ REGISTER_CURL_CONSTANT(CURLOPT_MAXFILESIZE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070d00 /* Available since 7.13.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_FTP_ACCOUNT);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070e01 /* Available since 7.14.1 */
+ REGISTER_CURL_CONSTANT(CURLOPT_COOKIELIST);
+ REGISTER_CURL_CONSTANT(CURLOPT_IGNORE_CONTENT_LENGTH);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070f02 /* Available since 7.15.2 */
+ REGISTER_CURL_CONSTANT(CURLOPT_CONNECT_ONLY);
+ REGISTER_CURL_CONSTANT(CURLOPT_LOCALPORT);
+ REGISTER_CURL_CONSTANT(CURLOPT_LOCALPORTRANGE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070f05 /* Available since 7.15.5 */
+ REGISTER_CURL_CONSTANT(CURLOPT_FTP_ALTERNATIVE_TO_USER);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071000 /* Available since 7.16.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_SSL_SESSIONID_CACHE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071001 /* Available since 7.16.1 */
+ REGISTER_CURL_CONSTANT(CURLOPT_FTP_SSL_CCC);
+ REGISTER_CURL_CONSTANT(CURLFTPSSL_CCC_NONE);
+ REGISTER_CURL_CONSTANT(CURLFTPSSL_CCC_ACTIVE);
+ REGISTER_CURL_CONSTANT(CURLFTPSSL_CCC_PASSIVE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071002 /* Available since 7.16.2 */
+ REGISTER_CURL_CONSTANT(CURLOPT_HTTP_CONTENT_DECODING);
+ REGISTER_CURL_CONSTANT(CURLOPT_HTTP_TRANSFER_DECODING);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071200 /* Available since 7.18.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_PROXY_TRANSFER_MODE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071300 /* Available since 7.19.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_ADDRESS_SCOPE);
+ REGISTER_CURL_CONSTANT(CURLOPT_CRLFILE);
+ REGISTER_CURL_CONSTANT(CURLOPT_ISSUERCERT);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
+ REGISTER_CURL_CONSTANT(CURLOPT_USERNAME);
+ REGISTER_CURL_CONSTANT(CURLOPT_PASSWORD);
+ REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERNAME);
+ REGISTER_CURL_CONSTANT(CURLOPT_PROXYPASSWORD);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071304 /* Available since 7.19.4 */
+ REGISTER_CURL_CONSTANT(CURLOPT_NOPROXY);
+ REGISTER_CURL_CONSTANT(CURLOPT_SOCKS5_GSSAPI_NEC);
+ REGISTER_CURL_CONSTANT(CURLOPT_SOCKS5_GSSAPI_SERVICE);
+ REGISTER_CURL_CONSTANT(CURLOPT_TFTP_BLKSIZE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071306 /* Available since 7.19.6 */
+ REGISTER_CURL_CONSTANT(CURLOPT_SSH_KNOWNHOSTS);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_PRET);
+ REGISTER_CURL_CONSTANT(CURLOPT_MAIL_FROM);
+ REGISTER_CURL_CONSTANT(CURLOPT_MAIL_RCPT);
+ REGISTER_CURL_CONSTANT(CURLOPT_RTSP_CLIENT_CSEQ);
+ REGISTER_CURL_CONSTANT(CURLOPT_RTSP_SERVER_CSEQ);
+ REGISTER_CURL_CONSTANT(CURLOPT_RTSP_SESSION_ID);
+ REGISTER_CURL_CONSTANT(CURLOPT_RTSP_STREAM_URI);
+ REGISTER_CURL_CONSTANT(CURLOPT_RTSP_TRANSPORT);
+ REGISTER_CURL_CONSTANT(CURLOPT_RTSP_REQUEST);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_OPTIONS);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_DESCRIBE);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_ANNOUNCE);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SETUP);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_PLAY);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_PAUSE);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_TEARDOWN);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_GET_PARAMETER);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_SET_PARAMETER);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECORD);
+ REGISTER_CURL_CONSTANT(CURL_RTSPREQ_RECEIVE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071403 /* Available since 7.21.3 */
+ REGISTER_CURL_CONSTANT(CURLOPT_RESOLVE);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071406 /* Available since 7.21.6 */
+ REGISTER_CURL_CONSTANT(CURLOPT_ACCEPT_ENCODING);
+ REGISTER_CURL_CONSTANT(CURLOPT_TRANSFER_ENCODING);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071800 /* Available since 7.24.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_DNS_SERVERS);
+#endif
+
/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC);
@@ -828,6 +930,13 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLFTPSSL_CONTROL);
REGISTER_CURL_CONSTANT(CURLFTPSSL_ALL);
#endif
+#if LIBCURL_VERSION_NUM >= 0x071100 /* Available since 7.17.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_USE_SSL);
+ REGISTER_CURL_CONSTANT(CURLUSESSL_NONE);
+ REGISTER_CURL_CONSTANT(CURLUSESSL_TRY);
+ REGISTER_CURL_CONSTANT(CURLUSESSL_CONTROL);
+ REGISTER_CURL_CONSTANT(CURLUSESSL_ALL);
+#endif
#if LIBCURL_VERSION_NUM > 0x071301
REGISTER_CURL_CONSTANT(CURLOPT_CERTINFO);
@@ -1673,8 +1782,15 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_FAILONERROR:
case CURLOPT_UPLOAD:
case CURLOPT_POST:
+#if LIBCURL_VERSION_NUM >= 0x071100 /* Available since 7.17.0 */
+ case CURLOPT_APPEND:
+ case CURLOPT_DIRLISTONLY:
+ case CURLOPT_NEW_DIRECTORY_PERMS:
+ case CURLOPT_NEW_FILE_PERMS:
+#else
case CURLOPT_FTPLISTONLY:
case CURLOPT_FTPAPPEND:
+#endif
case CURLOPT_NETRC:
case CURLOPT_PUT:
#if CURLOPT_MUTE != 0
@@ -1726,9 +1842,11 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
#if LIBCURL_VERSION_NUM >= 0x070c02
case CURLOPT_FTPSSLAUTH:
#endif
-#if LIBCURL_VERSION_NUM > 0x070b00
+#if LIBCURL_VERSION_NUM >= 0x071100 /* Available since 7.17.0 */
+ case CURLOPT_USE_SSL:
+#elif LIBCURL_VERSION_NUM > 0x070b00
case CURLOPT_FTP_SSL:
-#endif
+#endif
case CURLOPT_UNRESTRICTED_AUTH:
case CURLOPT_PORT:
case CURLOPT_AUTOREFERER:
@@ -1740,8 +1858,9 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_REDIR_PROTOCOLS:
case CURLOPT_PROTOCOLS:
#endif
-#if LIBCURL_VERSION_NUM > 0x070a07 /* CURLOPT_IPRESOLVE is available since curl 7.10.8 */
+#if LIBCURL_VERSION_NUM > 0x070a07 /* CURLOPT_IPRESOLVE and CURLOPT_FTP_RESPONSE_TIMEOUT are available since curl 7.10.8 */
case CURLOPT_IPRESOLVE:
+ case CURLOPT_FTP_RESPONSE_TIMEOUT:
#endif
#if LIBCURL_VERSION_NUM >= 0x070f01
case CURLOPT_FTP_FILEMETHOD:
@@ -1750,6 +1869,45 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
#if LIBCURL_VERSION_NUM > 0x071301
case CURLOPT_CERTINFO:
#endif
+#if LIBCURL_VERSION_NUM >= 0x070a08 /* Available since 7.10.8 */
+ case CURLOPT_MAXFILESIZE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070e01 /* Available since 7.14.1 */
+ case CURLOPT_IGNORE_CONTENT_LENGTH:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070f02 /* Available since 7.15.2 */
+ case CURLOPT_CONNECT_ONLY:
+ case CURLOPT_LOCALPORT:
+ case CURLOPT_LOCALPORTRANGE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071000 /* Available since 7.16.0 */
+ case CURLOPT_SSL_SESSIONID_CACHE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071001 /* Available since 7.16.1 */
+ case CURLOPT_FTP_SSL_CCC:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071002 /* Available since 7.16.2 */
+ case CURLOPT_HTTP_TRANSFER_DECODING:
+ case CURLOPT_HTTP_CONTENT_DECODING:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071200 /* Available since 7.18.0 */
+ case CURLOPT_PROXY_TRANSFER_MODE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071300 /* Available since 7.19.0 */
+ case CURLOPT_ADDRESS_SCOPE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071304 /* Available since 7.19.4 */
+ case CURLOPT_NOPROXY:
+ case CURLOPT_SOCKS5_GSSAPI_NEC:
+ case CURLOPT_TFTP_BLKSIZE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
+ case CURLOPT_FTP_USE_PRET:
+ case CURLOPT_RTSP_CLIENT_CSEQ:
+ case CURLOPT_RTSP_SERVER_CSEQ:
+ case CURLOPT_RTSP_REQUEST:
+#endif
+
convert_to_long_ex(zvalue);
#if LIBCURL_VERSION_NUM >= 0x71304
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
@@ -1797,7 +1955,11 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_COOKIE:
case CURLOPT_REFERER:
case CURLOPT_INTERFACE:
+#if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */
+ case CURLOPT_KRBLEVEL:
+#else
case CURLOPT_KRB4LEVEL:
+#endif
case CURLOPT_EGDSOCKET:
case CURLOPT_CAINFO:
case CURLOPT_CAPATH:
@@ -1808,10 +1970,38 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_SSLENGINE:
case CURLOPT_SSLENGINE_DEFAULT:
case CURLOPT_SSLCERTTYPE:
+#if LIBCURL_VERSION_NUM >= 0x071406 /* Available since 7.21.6 */
+ case CURLOPT_ACCEPT_ENCODING:
+ case CURLOPT_TRANSFER_ENCODING:
+#else
case CURLOPT_ENCODING:
-#if LIBCURL_VERSION_NUM >= 0x071300
- case CURLOPT_SSH_PUBLIC_KEYFILE:
- case CURLOPT_SSH_PRIVATE_KEYFILE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070d00 /* Available since 7.13.0 */
+ case CURLOPT_FTP_ACCOUNT:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070e01 /* Available since 7.14.1 */
+ case CURLOPT_COOKIELIST:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x070f05 /* Available since 7.15.5 */
+ case CURLOPT_FTP_ALTERNATIVE_TO_USER:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
+ case CURLOPT_USERNAME:
+ case CURLOPT_PASSWORD:
+ case CURLOPT_PROXYUSERNAME:
+ case CURLOPT_PROXYPASSWORD:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071304 /* Available since 7.19.4 */
+ case CURLOPT_SOCKS5_GSSAPI_SERVICE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
+ case CURLOPT_MAIL_FROM:
+ case CURLOPT_RTSP_SESSION_ID:
+ case CURLOPT_RTSP_TRANSPORT:
+ case CURLOPT_RTSP_STREAM_URI:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071800 /* Available since 7.24.0 */
+ case CURLOPT_DNS_SERVERS:
#endif
{
#if LIBCURL_VERSION_NUM < 0x071100
@@ -1819,17 +2009,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
#endif
convert_to_string_ex(zvalue);
-#if LIBCURL_VERSION_NUM >= 0x071300
- if (
- option == CURLOPT_SSH_PUBLIC_KEYFILE || option == CURLOPT_SSH_PRIVATE_KEYFILE
-
- ) {
- if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) {
- RETVAL_FALSE;
- return 1;
- }
- }
-#endif
if (option == CURLOPT_URL) {
if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue) TSRMLS_CC)) {
RETVAL_FALSE;
@@ -2116,14 +2295,46 @@ string_copy:
case CURLOPT_HTTPHEADER:
case CURLOPT_QUOTE:
case CURLOPT_HTTP200ALIASES:
- case CURLOPT_POSTQUOTE: {
+ case CURLOPT_POSTQUOTE:
+ case CURLOPT_PREQUOTE:
+#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
+ case CURLOPT_MAIL_RCPT:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071403 /* Available since 7.21.3 */
+ case CURLOPT_RESOLVE:
+#endif
+ {
zval **current;
HashTable *ph;
struct curl_slist *slist = NULL;
ph = HASH_OF(*zvalue);
if (!ph) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments");
+ char *name;
+ switch (option) {
+ case CURLOPT_HTTPHEADER:
+ name = "CURLOPT_HTTPHEADER";
+ break;
+ case CURLOPT_QUOTE:
+ name = "CURLOPT_QUOTE";
+ break;
+ case CURLOPT_HTTP200ALIASES:
+ name = "CURLOPT_HTTP200ALIASES";
+ break;
+ case CURLOPT_POSTQUOTE:
+ name = "CURLOPT_POSTQUOTE";
+ break;
+ case CURLOPT_PREQUOTE:
+ name = "CURLOPT_PREQUOTE";
+ break;
+ case CURLOPT_MAIL_RCPT:
+ name = "CURLOPT_MAIL_RCPT";
+ break;
+ case CURLOPT_RESOLVE:
+ name = "CURLOPT_RESOLVE";
+ break;
+ }
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the %s argument", name);
RETVAL_FALSE;
return 1;
}
@@ -2154,7 +2365,20 @@ string_copy:
case CURLOPT_COOKIEJAR:
case CURLOPT_SSLCERT:
case CURLOPT_RANDOM_FILE:
- case CURLOPT_COOKIEFILE: {
+ case CURLOPT_COOKIEFILE:
+#if LIBCURL_VERSION_NUM >= 0x070b00 /* Option available since 7.11.0 */
+ case CURLOPT_NETRC_FILE:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071300 /* Available since 7.19.0 */
+ case CURLOPT_SSH_PUBLIC_KEYFILE:
+ case CURLOPT_SSH_PRIVATE_KEYFILE:
+ case CURLOPT_CRLFILE:
+ case CURLOPT_ISSUERCERT:
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071306 /* Available since 7.19.6 */
+ case CURLOPT_SSH_KNOWNHOSTS:
+#endif
+ {
#if LIBCURL_VERSION_NUM < 0x071100
char *copystr = NULL;
#endif
diff --git a/ext/curl/tests/curl_setopt_basic003.phpt b/ext/curl/tests/curl_setopt_basic003.phpt
index 7849140..aa225c6 100644
--- a/ext/curl/tests/curl_setopt_basic003.phpt
+++ b/ext/curl/tests/curl_setopt_basic003.phpt
@@ -38,6 +38,6 @@ var_dump( $curl_content );
--EXPECTF--
*** curl_setopt() call with CURLOPT_HTTPHEADER
-Warning: curl_setopt(): You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments in %s on line %d
+Warning: curl_setopt(): You must pass either an object or an array with the CURLOPT_HTTPHEADER argument in %s on line %d
bool(false)
bool(true)