Don't strip tags from webhook agent
This commit is contained in:
@@ -1209,10 +1209,6 @@ def strip_tag(data, agent_id=None):
|
|||||||
'font': ['color']}
|
'font': ['color']}
|
||||||
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
||||||
|
|
||||||
elif agent_id in (10, 14, 20):
|
|
||||||
# Don't remove tags for Email, Slack, and Discord
|
|
||||||
pass
|
|
||||||
|
|
||||||
elif agent_id == 13:
|
elif agent_id == 13:
|
||||||
# Allow tags b, i, code, pre, a[href] for Telegram
|
# Allow tags b, i, code, pre, a[href] for Telegram
|
||||||
whitelist = {'b': [],
|
whitelist = {'b': [],
|
||||||
@@ -1222,6 +1218,10 @@ def strip_tag(data, agent_id=None):
|
|||||||
'a': ['href']}
|
'a': ['href']}
|
||||||
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
||||||
|
|
||||||
|
elif agent_id in (10, 14, 20, 25):
|
||||||
|
# Don't remove tags for Email, Slack, Discord, and Webhook
|
||||||
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
whitelist = {}
|
whitelist = {}
|
||||||
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
data = bleach.clean(data, tags=whitelist.keys(), attributes=whitelist, strip=True)
|
||||||
|
Reference in New Issue
Block a user