]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/lib/discoveryhints.php
Debugging log fix.
[quix0rs-gnu-social.git] / plugins / OStatus / lib / discoveryhints.php
index 4df7690038f6741347b13766c06175a213ae54c6..86bd72f477909149556a3741899d144fea95b145 100644 (file)
@@ -58,14 +58,20 @@ class DiscoveryHints {
     {
         $client = new HTTPClient();
         $client->setHeader('Accept', 'text/html,application/xhtml+xml');
-        $response = $client->get($url);
+        try {
+            $response = $client->get($url);
 
-        if (!$response->isOk()) {
+            if (!$response->isOk()) {
+                return null;
+            }
+        } catch (HTTP_Request2_Exception $e) {
+            // Any HTTPClient error that might've been thrown
+            common_log(LOG_ERR, __METHOD__ . ':'.$e->getMessage());
             return null;
         }
 
         return self::hcardHints($response->getBody(),
-                                $response->getUrl());
+                                $response->getEffectiveUrl());
     }
 
     static function hcardHints($body, $url)