Skip to content

Commit d9d58c9

Browse files
committed
Revert "Fixed GH-18458: Authorization set with CURLOPT_USERPWD with NULL value."
This reverts commit bb431f1.
1 parent bb431f1 commit d9d58c9

File tree

2 files changed

+1
-37
lines changed

2 files changed

+1
-37
lines changed

ext/curl/interface.c

+1-17
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,7 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
19001900
case CURLOPT_SSLKEYTYPE:
19011901
case CURLOPT_SSL_CIPHER_LIST:
19021902
case CURLOPT_USERAGENT:
1903+
case CURLOPT_USERPWD:
19031904
case CURLOPT_COOKIELIST:
19041905
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
19051906
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
@@ -1997,23 +1998,6 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
19971998
return ret;
19981999
}
19992000

2000-
case CURLOPT_USERPWD:
2001-
{
2002-
if (Z_ISNULL_P(zvalue)) {
2003-
// Authorization header would be implictly set
2004-
// with an empty string thus we explictly set the option
2005-
// to null to avoid this unwarranted side effect
2006-
error = curl_easy_setopt(ch->cp, option, NULL);
2007-
} else {
2008-
zend_string *tmp_str;
2009-
zend_string *str = zval_get_tmp_string(zvalue, &tmp_str);
2010-
zend_result ret = php_curl_option_str(ch, option, ZSTR_VAL(str), ZSTR_LEN(str));
2011-
zend_tmp_string_release(tmp_str);
2012-
return ret;
2013-
}
2014-
break;
2015-
}
2016-
20172001
/* Curl nullable string options */
20182002
case CURLOPT_CUSTOMREQUEST:
20192003
case CURLOPT_FTPPORT:

ext/curl/tests/gh18458.phpt

-20
This file was deleted.

0 commit comments

Comments
 (0)