changeset 930:dec2797d37bc

we only have comment input fields up to 200 chars, more is likely a spammer POSTing
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 08 Jul 2006 20:42:32 +0200
parents da5623bc6819
children 141083b64fb1
files MoinMoin/wikiutil.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wikiutil.py	Sat Jul 08 12:53:10 2006 +0200
+++ b/MoinMoin/wikiutil.py	Sat Jul 08 20:42:32 2006 +0200
@@ -244,6 +244,9 @@
     """ Clean comment - replace CR, LF, TAB by whitespace, delete control chars
         TODO: move this to config, create on first call then return cached.
     """
+    # we only have input fields with max 200 chars, but spammers send us more
+    if len(comment) > 201:
+        comment = u''
     remap_chars = {
         ord(u'\t'): u' ',
         ord(u'\r'): u' ',