fix: favicons endpoint to fallback to ico instead of throwing error

This commit is contained in:
Chirag Aggarwal
2025-08-04 17:14:38 +05:30
parent d28e0152fd
commit 84e3dc0275
+1 -5
View File
@@ -375,15 +375,11 @@ App::get('/v1/avatars/favicon')
throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED);
}
if ($res->getStatusCode() !== 200) {
throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED);
}
$doc = new DOMDocument();
$doc->strictErrorChecking = false;
@$doc->loadHTML($res->getBody());
$links = $doc->getElementsByTagName('link');
$links = $doc->getElementsByTagName('link') ?? [];
$outputHref = '';
$outputExt = '';
$space = 0;