enflow/component-spam-filter

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple PHP spam filter which checks input against a blacklist

dev-master 2019-09-04 12:15 UTC

This package is auto-updated.

Last update: 2020-09-04 14:30:09 UTC


README

Latest Version on Packagist Software License Build Status Total Downloads

The enflow/component-spam-filter package provides a easy way to check if a given text matches any of the blacklists.

Component is based on IQAndreas/php-spam-filter.

Installation

You can install the package via composer:

composer require enflow/component-spam-filter

Usage

use Enflow\Component\SpamFilter\SpamFilter;

$spamFilter = new SpamFilter();

$spamFilter->isPossibleSpam('fun gambling'); // true
$spamFilter->isPossibleSpam('keyword or full text without blacklisted words'); // false

To use a custom blacklist, specify your path in the constructor like where the *.txt files reside:

use Enflow\Component\SpamFilter\SpamFilter;

$spamFilter = new SpamFilter('path/to/blacklist');

Blacklist updates

Pull Requests for blacklist changes are always welcome! You can find the blacklist files on https://github.com/enflow-nl/spam-filter-blacklists Changes on this list are automatically pulled in with every composer update, as this package includes the master version of the spam-filter-blacklists package.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email michel@enflow.nl instead of using the issue tracker.

Changes

The original package from Andreas Renberg has been modified and cleanup, most notable changes:

  • Added support for a PSR-4 autoloader
  • Added tests
  • Removed the blacklist self updater

Credits

About Enflow

Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info on our website.

License

The GNU General Public License v3.0 (GPL-3.0). Please see License File for more information.