]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/ParseUrl.php
Preparations for a moderator role
[friendica.git] / src / Util / ParseUrl.php
index 33828848391410a843475080905a30d41af1eaa7..79f427a654df4b5f672bc52f3470ebe01deb2b5b 100644 (file)
@@ -70,7 +70,12 @@ class ParseUrl
                        $options = [];
                }
 
-               $curlResult = DI::httpClient()->head($url, array_merge([HttpClientOptions::ACCEPT_CONTENT => $accept], $options));
+               try {
+                       $curlResult = DI::httpClient()->head($url, array_merge([HttpClientOptions::ACCEPT_CONTENT => $accept], $options));
+               } catch (\Exception $e) {
+                       DI::logger()->debug('Got exception', ['url' => $url, 'message' => $e->getMessage()]);
+                       return [];
+               }
 
                // Workaround for systems that can't handle a HEAD request. Don't retry on timeouts.
                if (!$curlResult->isSuccess() && ($curlResult->getReturnCode() >= 400) && !in_array($curlResult->getReturnCode(), [408, 504])) {