Commit fe75ed06 authored by Nicolas Delaby's avatar Nicolas Delaby

if attribute value is None do not try to

call regex with.
[...]
 <p kind_of_attribute />
[...]


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33467 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c54d3fd3
...@@ -130,6 +130,8 @@ class StrippingParser(HTMLParser): ...@@ -130,6 +130,8 @@ class StrippingParser(HTMLParser):
if remove_script and k.strip().lower().startswith('on'): if remove_script and k.strip().lower().startswith('on'):
if not self.raise_error: continue if not self.raise_error: continue
else: raise IllegalHTML, 'Script event "%s" not allowed.' % k else: raise IllegalHTML, 'Script event "%s" not allowed.' % k
elif v is None:
self.result.append(' %s' % (k,))
elif remove_script and hasScript(v): elif remove_script and hasScript(v):
if not self.raise_error: continue if not self.raise_error: continue
else: raise IllegalHTML, 'Script URI "%s" not allowed.' % v else: raise IllegalHTML, 'Script URI "%s" not allowed.' % v
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment