diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index d4abcabcf3..4577f6325c 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -17,7 +17,7 @@ import requests allowed_tags = ('b','blockquote','br','code','del','em','h1','h2','h3','h4','h5','h6','hr','i', 'li','ol','p','pre','strong','sub','sup','table','tbody','th','thead','td','tr','ul', - 'marquee','a','span','ruby','rp','rt','spoiler','img','lite-youtube','video','source','audio','g') + 'marquee','a','span','ruby','rp','rt','spoiler','img','lite-youtube','video','audio','g') allowed_styles = ['color', 'background-color', 'font-weight', 'text-align', 'filter',] @@ -57,10 +57,8 @@ def allowed_attributes(tag, name, value): if tag == 'video': if name == 'controls' and value == '': return True if name == 'preload' and value == 'none': return True - return False - - if tag == 'source': if name == 'src': return is_safe_url(value) + return False if tag == 'audio': if name == 'src': return is_safe_url(value)