fixed CQ for bitmessageqt.safehtmlparser module
This commit is contained in:
parent
035fac1fc5
commit
6486b0fc99
|
@ -65,6 +65,8 @@ class SafeHTMLParser(HTMLParser):
|
||||||
HTMLParser.__init__(self, *args, **kwargs)
|
HTMLParser.__init__(self, *args, **kwargs)
|
||||||
self.reset()
|
self.reset()
|
||||||
self.reset_safe()
|
self.reset_safe()
|
||||||
|
self.has_html = None
|
||||||
|
self.allow_picture = None
|
||||||
|
|
||||||
def reset_safe(self):
|
def reset_safe(self):
|
||||||
"""Reset runtime variables specific to this class"""
|
"""Reset runtime variables specific to this class"""
|
||||||
|
@ -92,7 +94,7 @@ class SafeHTMLParser(HTMLParser):
|
||||||
if url.scheme not in self.src_schemes:
|
if url.scheme not in self.src_schemes:
|
||||||
val = ""
|
val = ""
|
||||||
self.sanitised += " " + quote_plus(attr)
|
self.sanitised += " " + quote_plus(attr)
|
||||||
if not (val is None):
|
if val is not None:
|
||||||
self.sanitised += "=\"" + val + "\""
|
self.sanitised += "=\"" + val + "\""
|
||||||
if inspect.stack()[1][3] == "handle_startendtag":
|
if inspect.stack()[1][3] == "handle_startendtag":
|
||||||
self.sanitised += "/"
|
self.sanitised += "/"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user