Skip to content

Commit 67af082

Browse files
author
Erik Forsberg
committed
Cope with spam robots posting with multiple instances of the same form
value. Details: http://psf.upfronthosting.co.za/roundup/meta/issue111
1 parent 24f1ae1 commit 67af082

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

roundup/cgi/templating.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2272,7 +2272,13 @@ def _post_init(self):
22722272
for name in ':search_text @search_text'.split():
22732273
if self.form.has_key(name):
22742274
self.special_char = name[0]
2275-
self.search_text = self.form[name].value
2275+
try:
2276+
self.search_text = self.form[name].value
2277+
except AttributeError:
2278+
# http://psf.upfronthosting.co.za/roundup/meta/issue111
2279+
# Multiple search_text, probably some kind of spambot.
2280+
# Use first value.
2281+
self.search_text = self.form[name][0].value
22762282

22772283
# pagination - size and start index
22782284
# figure batch args

0 commit comments

Comments
 (0)