Edgewall Software

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12722 closed enhancement (fixed)

Ticket comment edits are not passed through the SpamFilter

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: plugin - spam-filter
Component: plugin/spamfilter Version:
Severity: normal Keywords:
Cc: Dirk Stöcker Branch:
Release Notes:

Comment edits are passed through the spam filter with Trac 1.3.2 and later.

API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

First mentioned in comment:12:ticket:10909. It looks like changes are passed to the FilterSystem in plugins/1.2/spam-filter/tracspamfilter/adapters.py@:35#L25.

It looks like we may need to call ITicketManipulators when editing a comment, and then additional modifications to SpamFilter may be needed.

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 7 years ago

Description: modified (diff)

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

To check spam requires:

  • 1 an entry point which has access to the changed information
  • 2 the change to throw an exception
  • 3 is before the entry into the database
  • 4 has access to the "req" request variable.

  • The ITicketChangeListener seems only to fulfill point 1.
  • The ITicketManipulator does not cover that change yet.
  • Other solutions could use IRequestFilter, but these need to reimplement core stuff

The same issue exists for the new edit comment functionality.

Probable solution: Add a new ICommentManipulator interface which handles these ticket changes as well as the wiki comment changes, like…

class ICommentManipulator(Interface):
    """Miscellaneous manipulation of comments."""

    def prepare_commentchange(req, fields, actions):
        """Not currently called, but should be provided for future

    def validate_commentchange(req, old_comment, new_comment, type):
        """Validate a comment after it's been changed.

type may be "ticket", "wiki".

comment:3 by Ryan J Ollos, 7 years ago


comment:4 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in r15932. Trac r15743 (1.3.2dev) or later is required.

Last edited 7 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
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.