From 84e3dc0275a6beeb10daa913a82b22e9a692e68f Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 4 Aug 2025 17:14:38 +0530 Subject: [PATCH] fix: favicons endpoint to fallback to ico instead of throwing error --- app/controllers/api/avatars.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 1d50d2c899..785324739b 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -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;