]> git.mxchange.org Git - friendica.git/commitdiff
Issue 11109: Fix server detection
authorMichael <heluecht@pirati.ca>
Sat, 18 Dec 2021 09:59:30 +0000 (09:59 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 18 Dec 2021 09:59:30 +0000 (09:59 +0000)
src/Model/GServer.php

index af03041498d56cdb2ecaa36bf9afc3e5ced9a880..d133d7f18d2fc796bbf67081b8edd956b835c90a 100644 (file)
@@ -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()]);