Description

The Antispam feature is supposed to update only once an hour (unless there has been a failure, in which case it should update 1h after the last failure).

However, it updates every save causing:

Steps to reproduce

Simply save a page to trigger the antispam feature.

Example

http://wiki.winehq.org

Details

MoinMoin Version

any

OS and Version

Linux

Python Version

2.3

Server Setup

apache + ModPy

Server Details

CentOS 4.0

Language you are using the wiki in (set in the browser/UserPreferences)

English

Workaround

None.

Discussion

The implemenation (looking in the 1.6 codebase) can not work as is, since it compares the last edit time of the page (p.mtime_usecs()) to the current time. However, if the page does not update, the last edit time of the page will always be older than 1h, always triggering the condition.

One way to solve the problem would be to add fake saves, something along these lines:

diff -r b2322cdabd8a MoinMoin/security/antispam.py
--- a/MoinMoin/security/antispam.py     Tue Oct 03 15:32:55 2006 +0200
+++ b/MoinMoin/security/antispam.py     Thu Oct 12 14:57:09 2006 -0400
@@ -127,6 +127,8 @@ def getblacklist(request, pagename, do_u
                         raise WikirpcError("failed to get BadContent data",
                                            response)
                     p._write_file(response)
+                else:
+                    p._write_file(None, action='TOUCH')

                 invalidate_cache = True

Obviously, _write_file() would need to be modified to support the 'TOUCH' action, but that shouldn't be very difficult.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/AntispamUpdatesEveryTime (last edited 2007-10-29 19:06:40 by localhost)