@@ -80,6 +80,7 @@ public function __construct(array $options = array(), $followLocationMaxRedirect
8080 if (isset ($ options ['connection_timeout ' ])) {
8181 curl_setopt ($ this ->ch , CURLOPT_CONNECTTIMEOUT , $ options ['connection_timeout ' ]);
8282 }
83+
8384 if (isset ($ options ['proxy_host ' ])) {
8485 if (false !== $ options ['proxy_host ' ]) {
8586 $ proxyHost = $ options ['proxy_host ' ].(isset ($ options ['proxy_port ' ]) ? $ options ['proxy_port ' ] : 8080 );
@@ -88,10 +89,16 @@ public function __construct(array $options = array(), $followLocationMaxRedirect
8889 }
8990
9091 curl_setopt ($ this ->ch , CURLOPT_PROXY , $ proxyHost );
92+
93+ if (false !== $ proxyHost && isset ($ options ['proxy_login ' ])) {
94+ curl_setopt ($ this ->ch , CURLOPT_PROXYUSERPWD , $ options ['proxy_login ' ].': ' .$ options ['proxy_password ' ]);
95+
96+ if (isset ($ options ['proxy_auth ' ])) {
97+ curl_setopt ($ this ->ch , CURLOPT_PROXYAUTH , $ options ['proxy_auth ' ]);
98+ }
99+ }
91100 }
92- if (isset ($ options ['proxy_user ' ])) {
93- curl_setopt ($ this ->ch , CURLOPT_PROXYUSERPWD , $ options ['proxy_user ' ] . ': ' . $ options ['proxy_password ' ]);
94- }
101+
95102 if (isset ($ options ['login ' ])) {
96103 curl_setopt ($ this ->ch , CURLOPT_HTTPAUTH , isset ($ options ['extra_options ' ]['http_auth ' ]) ? $ options ['extra_options ' ]['http_auth ' ] : CURLAUTH_ANY );
97104 curl_setopt ($ this ->ch , CURLOPT_USERPWD , $ options ['login ' ].': ' .$ options ['password ' ]);
0 commit comments