mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 12:14:36 +00:00
corrected cookiereset + added check if key is set
This commit is contained in:
+3
-3
@@ -298,6 +298,7 @@ class Curl
|
||||
*/
|
||||
public function exec($ch = null)
|
||||
{
|
||||
$this->responseCookies = array();
|
||||
if (!($ch === null)) {
|
||||
$this->rawResponse = curl_multi_getcontent($ch);
|
||||
} else {
|
||||
@@ -305,7 +306,6 @@ class Curl
|
||||
$this->rawResponse = curl_exec($this->curl);
|
||||
$this->curlErrorCode = curl_errno($this->curl);
|
||||
}
|
||||
$this->responseCookies = array();
|
||||
$this->curlErrorMessage = curl_error($this->curl);
|
||||
$this->curlError = !($this->curlErrorCode === 0);
|
||||
$this->httpStatusCode = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);
|
||||
@@ -544,13 +544,13 @@ class Curl
|
||||
}
|
||||
|
||||
/**
|
||||
* get Cookie of Response
|
||||
* get Cookie of Response, if Key is set. Otherwise return NULL
|
||||
*
|
||||
* @access public
|
||||
* @param $key
|
||||
*/
|
||||
public function getResponseCookie($key) {
|
||||
return $this->responseCookies[$key];
|
||||
return (isset($this->responseCookies[$key]))?$this->responseCookies[$key]:NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user