Procedural File: _antispam.funcs.php
Source Location: /blogs/inc/antispam/model/_antispam.funcs.php
Functions
antispam_check [line 122]
string antispam_check(
$haystack
)
|
|
Check if a string contains abusive substrings
Note: Letting the database do the LIKE %% match is a little faster than doing in it PHP, not to mention the incredibly long overhead of preloading the list into PHP
Parameters:
API Tags:
| Return: | blacklisted keyword found or false if no spam detected |
Information Tags:
| Todo: | dh> IMHO this method is too generic used! It gets used for: - comment author name
- comment/message author email
- comment content
- message (email) content
- validate_url
..and validates all this against the antispam blacklist! We should rather differentiate here more and make it pluggable! |
antispam_create [line 48]
void antispam_create(
$abuse_string, [ $aspm_source = 'local']
)
|
|
antispam_create(-)
Insert a new abuse string into DB
Parameters:
|
|
$abuse_string: |
|
|
|
$aspm_source: |
|
antispam_delete [line 95]
void antispam_delete(
$string_ID
)
|
|
Parameters:
antispam_poll_abuse [line 201]
boolean antispam_poll_abuse(
)
|
|
Request abuse list from central blacklist.
API Tags:
| Return: | true = success, false = error |
antispam_report_abuse [line 153]
boolean antispam_report_abuse(
string $abuse_string
)
|
|
Pings b2evolution.net to report abuse from a particular domain.
Parameters:
|
string |
$abuse_string: |
The keyword to report as abuse. |
API Tags:
| Return: | True on success, false on failure. |
antispam_update_source [line 80]
void antispam_update_source(
$aspm_string, $aspm_source
)
|
|
antispam_update_source(-)
Note: We search by string because we sometimes don't know the ID (e-g when download already in list/cache)
Parameters:
|
|
$aspm_string: |
|
|
|
$aspm_source: |
|
get_ban_domain [line 300]
string|false get_ban_domain(
string $url
)
|
|
Get the base domain that could be blacklisted from an URL.
We want to concentrate on the main domain and we want to prefix it with either . or // in order not to blacklist too large.
Parameters:
|
string |
$url: |
URL or domain |
API Tags:
| Return: | the pattern to match this domain in the blacklist; false if we could not extract the base domain |
| Usedby: | referer_ban_link() |