Skip to content

Commit

Permalink
Have only one set of allowed elements/attributes for the sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Jul 14, 2016
1 parent c4dd677 commit 18a7102
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions html5lib/filters/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__all__ = ["Filter"]


acceptable_elements = frozenset((
allowed_elements = frozenset((
(namespaces['html'], 'a'),
(namespaces['html'], 'abbr'),
(namespaces['html'], 'acronym'),
Expand Down Expand Up @@ -175,7 +175,7 @@
(namespaces['svg'], 'use'),
))

acceptable_attributes = frozenset((
allowed_attributes = frozenset((
# HTML attributes
(None, 'abbr'),
(None, 'accept'),
Expand Down Expand Up @@ -552,7 +552,7 @@
(None, 'use')
))

acceptable_css_properties = frozenset((
allowed_css_properties = frozenset((
'azimuth',
'background-color',
'border-bottom-color',
Expand Down Expand Up @@ -601,7 +601,7 @@
'width',
))

acceptable_css_keywords = frozenset((
allowed_css_keywords = frozenset((
'auto',
'aqua',
'black',
Expand Down Expand Up @@ -643,7 +643,7 @@
'yellow',
))

acceptable_svg_properties = frozenset((
allowed_svg_properties = frozenset((
'fill',
'fill-opacity',
'fill-rule',
Expand All @@ -654,7 +654,7 @@
'stroke-opacity',
))

acceptable_protocols = frozenset((
allowed_protocols = frozenset((
'ed2k',
'ftp',
'http',
Expand All @@ -680,7 +680,7 @@
'data',
))

acceptable_content_types = frozenset((
allowed_content_types = frozenset((
'image/png',
'image/jpeg',
'image/gif',
Expand All @@ -689,14 +689,6 @@
'text/plain',
))

allowed_elements = acceptable_elements
allowed_attributes = acceptable_attributes
allowed_css_properties = acceptable_css_properties
allowed_css_keywords = acceptable_css_keywords
allowed_svg_properties = acceptable_svg_properties
allowed_protocols = acceptable_protocols
allowed_content_types = acceptable_content_types


data_content_type = re.compile(r'''
^
Expand Down

0 comments on commit 18a7102

Please sign in to comment.