From e9f5720c89b69da40e70bdc309081ee6ddc3d56d Mon Sep 17 00:00:00 2001
From: Teal Starsong <git@teal.is>
Date: Wed, 28 May 2025 13:18:58 +0200
Subject: [PATCH] feat: fix telegram link sanitizer

---
 app/jobs/telegram_group_chat_notification_job.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/jobs/telegram_group_chat_notification_job.rb b/app/jobs/telegram_group_chat_notification_job.rb
index 2348f09..c00c506 100644
--- a/app/jobs/telegram_group_chat_notification_job.rb
+++ b/app/jobs/telegram_group_chat_notification_job.rb
@@ -49,7 +49,7 @@ class TelegramGroupChatNotificationJob < NotificationJob
 
     # Sanitize HTML, keeping only allowed tags and attributes
     sanitizer = Rails::Html::SafeListSanitizer.new
-    text_to_send = sanitizer.sanitize(text_with_newlines, tags: allowed_tags, attributes: allowed_attributes)
+    text_to_send = sanitizer.sanitize(text_with_newlines, tags: allowed_tags, attributes: allowed_attributes.values.flatten)
 
     Rails.logger.info("TelegramGroupChatNotificationJob: Sending message: #{text_to_send[0..100]}...")
 
-- 
GitLab