Bugfixes
This commit is contained in:
@@ -184,9 +184,12 @@ PS
|
||||
|
||||
$body = @file_get_contents($url, false, $context);
|
||||
$statusCode = 0;
|
||||
$responseHeaders = function_exists('http_get_last_response_headers')
|
||||
? http_get_last_response_headers()
|
||||
: ($http_response_header ?? null);
|
||||
|
||||
if (isset($http_response_header) && is_array($http_response_header)) {
|
||||
foreach ($http_response_header as $headerLine) {
|
||||
if (is_array($responseHeaders)) {
|
||||
foreach ($responseHeaders as $headerLine) {
|
||||
if (preg_match('/^HTTP\/\S+\s+(\d{3})\b/', $headerLine, $matches) === 1) {
|
||||
$statusCode = (int) $matches[1];
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user