php 5.4 cURL does not support setting username and password separately

This commit is contained in:
Ahmad Nassri
2015-02-05 12:48:56 -05:00
parent 2074abf904
commit ae01978eb3

View File

@@ -350,8 +350,7 @@ class Request
}
if (!empty(self::$auth['user'])) {
curl_setopt($ch, CURLOPT_USERNAME, self::$auth['user']);
curl_setopt($ch, CURLOPT_PASSWORD, self::$auth['pass']);
curl_setopt($ch, CURLOPT_USERPWD, self::$auth['user'] . ':' . self::$auth['pass']);
curl_setopt($ch, CURLOPT_HTTPAUTH, self::$auth['method']);
}
@@ -362,8 +361,7 @@ class Request
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, self::$proxy['tunnel']);
curl_setopt($ch, CURLOPT_PROXYAUTH, self::$proxy['auth']['method']);
curl_setopt($ch, CURLOPT_PROXYUSERNAME, self::$proxy['auth']['user']);
curl_setopt($ch, CURLOPT_PROXYPASSWORD, self::$proxy['auth']['pass']);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, self::$proxy['auth']['user'] . ':' . self::$proxy['auth']['pass']);
}
$response = curl_exec($ch);