Edgewall Software

Opened 8 years ago

Last modified 8 years ago

#12503 closed defect

IndexError: list index out of range on trac submissing — at Initial Version

Reported by: strk@… Owned by: Dirk Stöcker
Priority: normal Milestone:
Component: plugin/spamfilter Version: 1.0.9
Severity: normal Keywords: sql
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I've found and fixed a bug in version 1.0.9dev of the TracSpamFilter plugin (the only one that I was able to install somehow). The bug is only exposed in new installs, while the spam clean procedure did not run yet. I think you can reproduce by deleting from the "system" table the entry with name = 'spamfilter_lastclean'.

Here's the patch:

--- api.py.000  2016-06-03 07:49:53.000000000 -0700
+++ api.py      2016-06-03 07:52:23.000000000 -0700
@@ -241,8 +241,7 @@
             row = self.env.db_query("SELECT value FROM system "
                                     "WHERE name='spamfilter_lastclean'")
+            last = int(row[0][0])
         except:
             pass
-        else:
-            last = int(row[0][0])
         tim = int(time.time())
         if last+self.captcha_cleantime < tim:

Please let me know if there's a more recent version of the plugin I should be using instead. This is against Trac 1.0.5. Thanks.

Change History (0)

Note: See TracTickets for help on using tickets.