Skip to content

Commit 740fa5b

Browse files
author
Ich
committed
corrected cookiereset + added check if key is set
1 parent 0c070b2 commit 740fa5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Curl/Curl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,14 @@ public function error($callback)
298298
*/
299299
public function exec($ch = null)
300300
{
301+
$this->responseCookies = array();
301302
if (!($ch === null)) {
302303
$this->rawResponse = curl_multi_getcontent($ch);
303304
} else {
304305
$this->call($this->beforeSendFunction);
305306
$this->rawResponse = curl_exec($this->curl);
306307
$this->curlErrorCode = curl_errno($this->curl);
307308
}
308-
$this->responseCookies = array();
309309
$this->curlErrorMessage = curl_error($this->curl);
310310
$this->curlError = !($this->curlErrorCode === 0);
311311
$this->httpStatusCode = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
@@ -544,13 +544,13 @@ public function setCookie($key, $value)
544544
}
545545

546546
/**
547-
* get Cookie of Response
547+
* get Cookie of Response, if Key is set. Otherwise return NULL
548548
*
549549
* @access public
550550
* @param $key
551551
*/
552552
public function getResponseCookie($key) {
553-
return $this->responseCookies[$key];
553+
return (isset($this->responseCookies[$key]))?$this->responseCookies[$key]:NULL;
554554
}
555555

556556
/**

0 commit comments

Comments
 (0)