From 64245f3654460ec574689d55eb344b2d85654fe9 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 18 Aug 2004 21:30:40 +0000 Subject: [PATCH] MFH: Fixed bug #29727 (Added missing CURL authentication directives). --- NEWS | 1 + ext/curl/curl.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/NEWS b/NEWS index 749a1efe0f..cef0f3d267 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2004, Version 4.3.9 - Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev) +- Fixed bug #29727 (Added missing CURL authentication directives). (Ilia) - Fixed bug #29719 (fgetcsv() has problem parsing strings ending with escaped enclosures). (Ilia) - Fixed bug #29599 (domxml_error segfaults another apache module). (Rob) diff --git a/ext/curl/curl.c b/ext/curl/curl.c index 549441ef0e..e3fa882e08 100644 --- a/ext/curl/curl.c +++ b/ext/curl/curl.c @@ -205,6 +205,21 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLOPT_ENCODING); #endif +#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */ + REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH); + /* http authentication options */ + REGISTER_CURL_CONSTANT(CURLAUTH_BASIC); + REGISTER_CURL_CONSTANT(CURLAUTH_DIGEST); + REGISTER_CURL_CONSTANT(CURLAUTH_GSSNEGOTIATE); + REGISTER_CURL_CONSTANT(CURLAUTH_NTLM); + REGISTER_CURL_CONSTANT(CURLAUTH_ANY); + REGISTER_CURL_CONSTANT(CURLAUTH_ANYSAFE); +#endif + +#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */ + REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH); +#endif + /* Constants effecting the way CURLOPT_CLOSEPOLICY works */ REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED); REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC); @@ -764,6 +779,12 @@ PHP_FUNCTION(curl_setopt) case CURLOPT_HTTPGET: case CURLOPT_HTTP_VERSION: case CURLOPT_CRLF: +#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */ + case CURLOPT_HTTPAUTH: +#endif +#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */ + case CURLOPT_PROXYAUTH: +#endif convert_to_long_ex(zvalue); error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; -- 2.40.0