I am using antispam with defensio and it seems to work well, but the comments are not being checked against defensio's profanity filter. I tried to edit the module to get it to check the response but cannot seem to get it working. Has anyone out there figured this one out?

CommentFileSizeAuthor
#7 antispam.tar_.gz38.04 KBalfared
#4 antispam.tar_.gz39.11 KBrandalls
#3 antispam.tar_.gz39.1 KBrandalls
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pixture’s picture

I think that profanity filter comes with Defensio 2.0 (with Defensio API 2.0).
AntiSpam currently uses Defensio API 1.2.

I am thinking of upgrating the API version but I do not have time to do it right now.
Maybe sometime next year. If someone can help, I would appreciate it.

alfared’s picture

That makes sense as to why I wasn't getting a profanity-match result. I will take a look at it and see if I can help. Thanks.

randalls’s picture

Assigned: Unassigned » randalls
FileSize
39.1 KB

I have updated the module to support Defensio Version 2. Please see the attached archive and give it a test run. It should be a drop in replacement for Drupal 6 and there will be an additional option for defensio version 2. I opted not change anything with the original defensio. Just add your defensio key to the version 2 text box in the admin menu and it should work.

My code supports the profanity filter. However profanity is still classified as spam, so the spam reports will incorporate profanity results into the statistics. If you want to see separate graphs for spam and profanity, more work will have to be done.

I am using Postgresql, so I made some changes for the SQL to work with Postgres using coalesce instead of NULLIF. If this is a problem, let me know and I will change it back. But coalesce should work just the same.

If there are profanity words that are not being picked up, go to your defensio account and add the words you want. This is also true for other languages.

Some other ideas to implement including using the filter and checking the results against the filter, possibly returning sanitized content. However, still does not fix spam.

I have not tested the other spam filters, so I am not sure how the profanity functionality will impact the other services.

I would appreciate if folks would test this and give me feedback as soon as possible. I will coordinate with the maintainer of this project to see if/how to incorporate my changes.

Thanks,

Randall

randalls’s picture

FileSize
39.11 KB

There was a bug in the release above that prevented the defensio antispam module from properly detecting spam.

randalls’s picture

md5sum for the file:

14ddd74f9b0a02d37ffdd1ba673c8602 *antispam.tar.gz

pixture’s picture

> @randalls,

Thank you for the work you've. Right now, I'm too busy to review your code. But I will do it sometime soon.

alfared’s picture

FileSize
38.04 KB

Here is your help pixture. I made a change to randalls antispam.admin.inc to fix the backend so it will now show the spaminess bar. Check the attached file. Hopefully this helps. Thanks randalls!

alfared’s picture

The only other feature that may be nice is a profanity bar like the spaminess one in the backend. Not necessary, but might be nice. Also, some people may want to turn off the profanity filter. Not sure why they would though.

randalls’s picture

I will see what I can do. I think it would be easy to enable or disable the profanity filter.

Another thing I have been thinking about is the architecture of the project. Right now integrating spam filters is more difficult than it should be. I am thinking that if we can change up the architecture so it is more Object Oriented and implement a Factory pattern so we can abstract away the intricacies of all the various spam filters. All drupal needs to know is "Do I publish this content or do I not publish this content." The why, when, where and how can be reserved for a report module. You would basically define an object, that would be an Defensio or akismet or any other type of object that would represent those services. It would inherit from a base class and be required to implement certain methods based on Interface. At run time, another class would determine which spam module to load depending the configuration. The defensio service object then would be responsible for providing all the functionality related to working with Defensio. This would make the project a lot easier to maintain. Right now, a lot of tweaking is required to make the entire module work with additional functionality.

Furthermore, this way, it would be easy for the vendors of these products to integrate with Drupal via the antispam module. It could be the spam module to rule them all.

For a side project, I may attempt to hack a prototype of this.

cfinke’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Defensio has since shut down. Closing.