This commit is contained in:
Eskimue
2026-04-05 14:01:17 +02:00
parent 2689a32ed6
commit 24096a49a1
5 changed files with 153 additions and 27 deletions
+5 -2
View File
@@ -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;