Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12503 closed defect (fixed)

IndexError: list index out of range on trac submissing

Reported by: strk@… Owned by: Ryan J Ollos
Priority: normal Milestone:
Component: plugin/spamfilter Version: 1.0.9
Severity: normal Keywords: sql
Cc: Branch:
Release Notes:

Fixed IndexError when rejecting content (regression in r14617).

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.

Attachments (0)

Change History (5)

comment:1 by Ryan J Ollos, 8 years ago

Owner: changed from Dirk Stöcker to Ryan J Ollos
Status: newassigned

comment:2 by Dirk Stöcker, 8 years ago

Regression from r14617. What was the reason for this changeset?

It does cosmetics and the introduction of a bug. Actually I consider such cosmetic changes as bad. They don't improve the software at all and like here always have the chance of new bugs.

comment:3 by Ryan J Ollos, 8 years ago

Resolution: fixed
Status: assignedclosed

Thanks for reporting. In [14825] I committed a fix that fixes the regression and transforms the code into idiomatic Trac code.

comment:4 by Ryan J Ollos, 8 years ago

API Changes: modified (diff)

comment:5 by Ryan J Ollos, 8 years ago

API Changes: modified (diff)
Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.