From 4ee53e051ea65420362bc350ec30c3bcadc6eac8 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Sat, 12 Sep 2026 14:50:19 -0400 Subject: [PATCH] fix: sanitize user-typed notification target ids the same way generated ones are (#29947) --- backend/open_webui/utils/notifications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/notifications.py b/backend/open_webui/utils/notifications.py index 9e63d02f08..8b6f090b4c 100644 --- a/backend/open_webui/utils/notifications.py +++ b/backend/open_webui/utils/notifications.py @@ -46,8 +46,8 @@ def _normalize_target(target: dict[str, Any], existing: dict[str, Any] | None = target_id = str(target.get('id') or existing.get('id') or '').strip() if not target_id: - hostname = urlparse(url).hostname or 'webhook' - target_id = re.sub(r'[^a-zA-Z0-9_-]+', '-', hostname).strip('-').lower() or 'target' + target_id = urlparse(url).hostname or 'webhook' + target_id = re.sub(r'[^a-zA-Z0-9_-]+', '-', target_id).strip('-').lower() or 'target' events = target['events'] if 'events' in target else existing.get('events', []) if events is None: