diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php index 7d3c98e245..51adf55fb7 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php @@ -97,7 +97,8 @@ class Get extends Action $space = 0; $linkTags = []; - \preg_match_all('/]*>/i', $res->getBody(), $linkTags); + $html = \preg_replace('//s', '', $res->getBody()) ?? $res->getBody(); + \preg_match_all('/]*>/i', $html, $linkTags); foreach ($linkTags[0] ?? [] as $tag) { $attributes = []; @@ -107,7 +108,7 @@ class Get extends Action foreach ($attributeMatches as $attributeMatch) { $attributes[\strtolower($attributeMatch[1])] = \html_entity_decode( - $attributeMatch[2] ?: $attributeMatch[3] ?: $attributeMatch[4], + $attributeMatch[2] !== '' ? $attributeMatch[2] : ($attributeMatch[3] !== '' ? $attributeMatch[3] : $attributeMatch[4]), \ENT_QUOTES | \ENT_HTML5 ); }