mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-31 04:34:27 +00:00
Fix static analysis error
Error message:
ERROR: InvalidArrayOffset - ../src/Curl/Curl.php:2182:25 - Cannot
access value on variable $response_header_array using a int<-1, max>
offset, expecting int<0, max> (see https://psalm.dev/115)
if (stripos($response_header_array[$i], 'HTTP/') === 0) {
This commit is contained in:
+1
-1
@@ -2178,7 +2178,7 @@ class Curl
|
||||
$response_header_array = explode("\r\n\r\n", $raw_response_headers);
|
||||
$response_header = '';
|
||||
for ($i = count($response_header_array) - 1; $i >= 0; $i--) {
|
||||
if (stripos($response_header_array[$i], 'HTTP/') === 0) {
|
||||
if (isset($response_header_array[$i]) && stripos($response_header_array[$i], 'HTTP/') === 0) {
|
||||
$response_header = $response_header_array[$i];
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user