From: Michael Date: Sat, 18 Dec 2021 09:59:30 +0000 (+0000) Subject: Issue 11109: Fix server detection X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=11e8ae52e00740fbbe0089b9ed633a80e1f6761a;p=friendica.git Issue 11109: Fix server detection --- diff --git a/src/Model/GServer.php b/src/Model/GServer.php index af03041498..d133d7f18d 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -349,7 +349,7 @@ class GServer } // On a redirect follow the new host but mark the old one as failure - if ($curlResult->isSuccess() && (parse_url($url, PHP_URL_HOST) != parse_url($curlResult->getRedirectUrl(), PHP_URL_HOST))) { + if ($curlResult->isSuccess() && !empty($curlResult->getRedirectUrl()) && (parse_url($url, PHP_URL_HOST) != parse_url($curlResult->getRedirectUrl(), PHP_URL_HOST))) { $curlResult = DI::httpClient()->get($url, [HttpClientOptions::TIMEOUT => $xrd_timeout]); if (parse_url($url, PHP_URL_HOST) != parse_url($curlResult->getRedirectUrl(), PHP_URL_HOST)) { Logger::info('Found redirect. Mark old entry as failure', ['old' => $url, 'new' => $curlResult->getRedirectUrl()]);