Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Client/Adapter/Curl.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,15 @@ public function connect($host, $port = 80, $secure = false)
204204
curl_setopt($this->curl, CURLOPT_PORT, intval($port));
205205
}
206206

207-
// Set timeout
208-
curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, $this->config['timeout']);
207+
if (isset($this->config['timeout'])) {
208+
// Set timeout
209+
curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, $this->config['timeout']);
210+
}
209211

210-
// Set Max redirects
211-
curl_setopt($this->curl, CURLOPT_MAXREDIRS, $this->config['maxredirects']);
212+
if (isset($this->config['maxredirects'])) {
213+
// Set Max redirects
214+
curl_setopt($this->curl, CURLOPT_MAXREDIRS, $this->config['maxredirects']);
215+
}
212216

213217
if (!$this->curl) {
214218
$this->close();

0 commit comments

Comments
 (0)