Simple PHP spam filter which checks input against a blacklist
This package is auto-updated.
Last update: 2020-09-04 14:30:09 UTC
enflow/component-spam-filter package provides a easy way to check if a given text matches any of the blacklists.
Component is based on
You can install the package via composer:
composer require enflow/component-spam-filter
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');
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.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email firstname.lastname@example.org instead of using the issue tracker.
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
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.
The GNU General Public License v3.0 (GPL-3.0). Please see License File for more information.