Download the PHP package flexic/spam-filter without Composer
On this page you can find all versions of the php package flexic/spam-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download flexic/spam-filter
More information about flexic/spam-filter
Files in flexic/spam-filter
Package spam-filter
Short Description A PHP Spam-Filter
License GPL-3.0-or-later
Homepage https://www.themepoint.de
Informations about the package spam-filter
Spam Filter
The Spam-Filter package defines an object-oriented layer for checking strings about spam.
Build-in Filter Types
Regex Filter
The Regex Filter is build to match Spam by an array of Regex patterns. If a regex pattern result matches the input will rate as spam.
Blacklist Filter
The Blacklist Filter is used to match Spam by an array of patterns. If the input contain a pattern it will rate as spam .
Whitelist Filter
The Whitelist Filter is build to check if the input contains any whitelisted patterns. If no whitelisted pattern contained the input will rate as spam.
Url Filter
The URL Filter is build to match if the input contains url's.
Duplication Filter
The Duplication Filter is build to match word duplications in text's.
The $minConsecutiveWords
defines if only words or sentences with a specific length will be matched.
Warning: For larger text this filter performs a lot of operations.
Example
Create custom filter
The Spam-Filter supports the creation of custom filters.
The Custom-Filters must implement the \ThemePoint\SpamFilter\Filter\FilterInterface
with it's defined functions.
Example:
Pay attention to the following behavior of the check
function:
- Return
true
if spam is detected in input. - Return
false
if no spam is detected in input.
Exceptions
You can control how the Spam Filter react if an exception is thrown.
The value of $responseOnException
is equivalent to the filter results.
If you want that the Spam Filter defines an input as Spam if an exception is thrown set this value to true
.
Changelog
[1.0]
- Initial commit of package