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