CSS prevention changed to a oneliner

This commit is contained in:
Stefan Ritter 2009-03-09 16:17:15 +01:00
parent 1649dab547
commit d03506dd2a

View File

@ -54,12 +54,12 @@ if not ctext: ctext = ""
# Comment to commit?
if cname and ctext and ctitle:
# Prevent XSS hacks
cname = cname.replace("<", "&lt;")
cname = cname.replace(">", "&gt;")
cname = cname.replace("\"", "&quot;")
ctext = ctext.replace("<", "&lt;")
ctext = ctext.replace(">", "&gt;")
ctext = ctext.replace("\"", "&quot;")
cname = cname.replace("<", "&lt;") \
.replace(">", "&gt;") \
.replace("\"", "&quot;")
ctext = ctext.replace("<", "&lt;") \
.replace(">", "&gt;") \
.replace("\"", "&quot;")
# Add comment
comments_file = glob.glob(entries_dir + ctitle + '.comments')