Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Fix proxy_server config access
Browse files Browse the repository at this point in the history
Fixes #41
  • Loading branch information
chillu committed Jan 12, 2018
1 parent 9fdbfed commit 2fd1a7f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions code/RecaptchaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,12 @@ class RecaptchaField_HTTPClient extends Object
public function post($url, $postVars)
{
$ch = curl_init($url);
if (!empty(RecaptchaField::$proxy_server)) {
curl_setopt($ch, CURLOPT_PROXY, RecaptchaField::$proxy_server);
if (!empty(RecaptchaField::$proxy_auth)) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, RecaptchaField::$proxy_auth);
$proxyServer = Config::inst()->get('RecaptchaField', 'proxy_server');
if (!empty($proxyServer)) {
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
$proxyAuth = Config::inst()->get('RecaptchaField', 'proxy_auth');
if (!empty($proxyAuth)) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth);
}
}

Expand Down

0 comments on commit 2fd1a7f

Please sign in to comment.