From 92166384d35fcfaf3206f976baca8612b96b9ff2 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 6 Apr 2026 20:42:31 +0530 Subject: [PATCH] Ignore script and style blocks in favicon parsing --- src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php b/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php index 51adf55fb7..53a859b64f 100644 --- a/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php +++ b/src/Appwrite/Platform/Modules/Avatars/Http/Favicon/Get.php @@ -97,7 +97,10 @@ class Get extends Action $space = 0; $linkTags = []; - $html = \preg_replace('//s', '', $res->getBody()) ?? $res->getBody(); + $html = $res->getBody(); + $html = \preg_replace('//s', '', $html) ?? $html; + $html = \preg_replace('/]*>.*?<\/script>/is', '', $html) ?? $html; + $html = \preg_replace('/]*>.*?<\/style>/is', '', $html) ?? $html; \preg_match_all('/]*>/i', $html, $linkTags); foreach ($linkTags[0] ?? [] as $tag) {