aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2009-03-09 16:17:15 +0100
committerStefan Ritter <xeno@thehappy.de>2009-03-09 16:17:15 +0100
commitd03506dd2a8ff30e7dcc14e49c121f4dedaa352d (patch)
tree7540598ff2e996aabc8d58fbbe93c32d0713157e
parent1649dab5479f43fca1829c0a82b8530d724e8862 (diff)
CSS prevention changed to a oneliner
-rwxr-xr-xblogthon.cgi12
1 files changed, 6 insertions, 6 deletions
diff --git a/blogthon.cgi b/blogthon.cgi
index 09e6112..f2a3d0e 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -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')