From: Sriram Natarajan Date: Thu, 24 Sep 2009 18:20:49 +0000 (+0000) Subject: - Fixed bug #49571 (CURLOPT_POSTREDIR not implemented). X-Git-Tag: php-5.2.12RC1~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bbba732e79e25279af414fb36a1c9ba05f66e725;p=php - Fixed bug #49571 (CURLOPT_POSTREDIR not implemented). --- diff --git a/NEWS b/NEWS index 7910e93fa0..23a232b982 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ PHP NEWS of a multibyte character). (Moriyoshi) - Fixed bug #49528 (UTF-16 strings prefixed by BOMs wrondly converted). (Moriyoshi) +- Fixed bug #49571 (CURLOPT_POSTREDIR not implemented). + (Sriram Natarajan) 17 Sep 2009, PHP 5.2.11 - Fixed certificate validation inside php_openssl_apply_verification_policy. diff --git a/ext/curl/interface.c b/ext/curl/interface.c index f5b4c51de8..d322f72b51 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -649,6 +649,10 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLFTPSSL_ALL); #endif +#if LIBCURL_VERSION_NUM > 0x071301 + REGISTER_CURL_CONSTANT(CURLOPT_POSTREDIR); +#endif + #if LIBCURL_VERSION_NUM >= 0x071304 REGISTER_CURL_CONSTANT(CURLOPT_REDIR_PROTOCOLS); REGISTER_CURL_CONSTANT(CURLOPT_PROTOCOLS); @@ -1381,6 +1385,12 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu } error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; +#if LIBCURL_VERSION_NUM > 0x071301 + case CURLOPT_POSTREDIR: + convert_to_long_ex(zvalue); + error = curl_easy_setopt(ch->cp, CURLOPT_POSTREDIR, Z_LVAL_PP(zvalue) & CURL_REDIR_POST_ALL); + break; +#endif case CURLOPT_PRIVATE: case CURLOPT_URL: case CURLOPT_PROXY: