修复xss filter导致的html被错误修改的问题 #29

This commit is contained in:
virusdefender 2016-04-07 17:17:49 +08:00
parent 69cf91f5e2
commit a5a440b9df

View File

@ -61,10 +61,8 @@ class XssHtml(HTMLParser):
Get the safe html code
"""
for i in range(0, len(self.result)):
tmp = self.result[i].rstrip('\n')
tmp = tmp.lstrip('\n')
if tmp:
self.data.append(tmp)
if self.result[i].strip('\n'):
self.data.append(self.result[i])
return ''.join(self.data)
def handle_startendtag(self, tag, attrs):