diff --git a/src/Client/Adapter/Curl.php b/src/Client/Adapter/Curl.php index 222598cf24..2c1564a624 100644 --- a/src/Client/Adapter/Curl.php +++ b/src/Client/Adapter/Curl.php @@ -204,11 +204,15 @@ public function connect($host, $port = 80, $secure = false) curl_setopt($this->curl, CURLOPT_PORT, intval($port)); } - // Set timeout - curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, $this->config['timeout']); + if (isset($this->config['timeout'])) { + // Set timeout + curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, $this->config['timeout']); + } - // Set Max redirects - curl_setopt($this->curl, CURLOPT_MAXREDIRS, $this->config['maxredirects']); + if (isset($this->config['maxredirects'])) { + // Set Max redirects + curl_setopt($this->curl, CURLOPT_MAXREDIRS, $this->config['maxredirects']); + } if (!$this->curl) { $this->close();