mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-29 08:32:08 +00:00
修复xss filter导致的html被错误修改的问题 #29
This commit is contained in:
parent
69cf91f5e2
commit
a5a440b9df
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user