[Moin-user] Intelligent Moinmoin wiki spam bot
Tim Bird
tim.bird at am.sony.com
Mon Feb 19 23:00:28 EST 2007
Gnarlodious wrote:
> On 2/18/07, Tim Bird wrote:
>
>> I have now disallowed
>>uploading .html files on my site.
>
> How did you do that? I can find no information on it.
I modified MoinMoin/action/AttachFile.py as follows:
--- AttachFile.py.orig 2007-02-20 12:51:30.000000000 +0900
+++ AttachFile.py.new 2007-02-20 12:53:02.000000000 +0900
@@ -492,6 +492,14 @@
# ext = ''
# target = target + ext
+ # TRB -2/9/2007 - disallow uploading .html files
+ # this is to thwart one obnoxious spammer
+ if target.find(".html") != -1:
+ msg = _("Attachment '%s' not allowed.") % target
+ # return attachment list
+ upload_form(pagename, request, msg)
+ return
+
# get directory, and possibly create it
attach_dir = getAttachDir(request, pagename, create=1)
# save file
=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Electronics
=============================
More information about the Moin-user
mailing list