Skip to content

Commit

Permalink
Merge pull request #83 from felixkraneveld/patch-1
Browse files Browse the repository at this point in the history
Php 8.1 fixes
  • Loading branch information
amouhzi authored Nov 30, 2021
2 parents 8a3e3f1 + 4136b4b commit 043dc00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Curl/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ protected function exec()
$this->http_error = $this->isError();
$this->error = $this->curl_error || $this->http_error;
$this->error_code = $this->error ? ($this->curl_error ? $this->getErrorCode() : $this->getHttpStatus()) : 0;
$this->request_headers = preg_split('/\r\n/', curl_getinfo($this->curl, CURLINFO_HEADER_OUT), null, PREG_SPLIT_NO_EMPTY);
$this->request_headers = preg_split('/\r\n/', curl_getinfo($this->curl, CURLINFO_HEADER_OUT), -1, PREG_SPLIT_NO_EMPTY);
$this->http_error_message = $this->error ? (isset($this->response_headers['0']) ? $this->response_headers['0'] : '') : '';
$this->error_message = $this->curl_error ? $this->getErrorMessage() : $this->http_error_message;

Expand Down Expand Up @@ -715,8 +715,8 @@ public function getResponseHeaders($headerKey = null)
foreach ($this->response_headers as $header) {
$parts = explode(":", $header, 2);

$key = isset($parts[0]) ? $parts[0] : null;
$value = isset($parts[1]) ? $parts[1] : null;
$key = isset($parts[0]) ? $parts[0] : '';
$value = isset($parts[1]) ? $parts[1] : '';

$headers[trim(strtolower($key))] = trim($value);
}
Expand Down

0 comments on commit 043dc00

Please sign in to comment.