]> git.mxchange.org Git - friendica.git/blobdiff - src/Network/Probe.php
Merge pull request #8401 from annando/gfollower-epilogue
[friendica.git] / src / Network / Probe.php
index ba58ff3d0437a469172bb7d2d4629cb10c9bceb4..b5991934b4912d16caeec3b6b0204ca3631cc43f 100644 (file)
@@ -144,10 +144,10 @@ class Probe
 
                // Handles the case when the hostname contains the scheme
                if (!parse_url($host, PHP_URL_SCHEME)) {
-                       $ssl_url = "https://".$host."/.well-known/host-meta";
-                       $url = "http://".$host."/.well-known/host-meta";
+                       $ssl_url = "https://" . $host . "/.well-known/host-meta";
+                       $url = "http://" . $host . "/.well-known/host-meta";
                } else {
-                       $ssl_url = $host."/.well-known/host-meta";
+                       $ssl_url = $host . "/.well-known/host-meta";
                        $url = '';
                }
 
@@ -161,14 +161,18 @@ class Probe
                if ($curlResult->isSuccess()) {
                        $xml = $curlResult->getBody();
                        $xrd = XML::parseString($xml, false);
-                       $host_url = 'https://'.$host;
+                       if (!empty($url)) {
+                               $host_url = 'https://' . $host;
+                       } else {
+                               $host_url = $host;
+                       }
                } elseif ($curlResult->isTimeout()) {
                        Logger::info('Probing timeout', ['url' => $ssl_url], Logger::DEBUG);
                        self::$istimeout = true;
                        return false;
                }
 
-               if (!is_object($xrd) && ! empty($url)) {
+               if (!is_object($xrd) && !empty($url)) {
                        $curlResult = Network::curl($url, false, ['timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml']);
                        $connection_error = ($curlResult->getErrorNumber() == CURLE_COULDNT_CONNECT) || ($curlResult->getReturnCode() == 0);
                        if ($curlResult->isTimeout()) {