private function Cleantalk::filterRequest in Anti Spam by CleanTalk 8.3
Filter request params
Parameters
CleantalkRequest $request:
Return value
type
3 calls to Cleantalk::filterRequest()
- Cleantalk::isAllowMessage in src/
lib/ Cleantalk/ Antispam/ Cleantalk.php - Function checks whether it is possible to publish the message
- Cleantalk::isAllowUser in src/
lib/ Cleantalk/ Antispam/ Cleantalk.php - Function checks whether it is possible to publish the message
- Cleantalk::sendFeedback in src/
lib/ Cleantalk/ Antispam/ Cleantalk.php - Function sends the results of manual moderation
File
- src/
lib/ Cleantalk/ Antispam/ Cleantalk.php, line 153
Class
- Cleantalk
- Cleantalk class create request
Namespace
Drupal\cleantalk\lib\Cleantalk\AntispamCode
private function filterRequest(CleantalkRequest $request) {
// general and optional
foreach ($request as $param => $value) {
if (in_array($param, array(
'message',
'example',
'agent',
'sender_info',
'sender_nickname',
'post_info',
'phone',
)) && !empty($value)) {
if (!is_string($value) && !is_integer($value)) {
$request->{$param} = NULL;
}
}
if (in_array($param, array(
'stoplist_check',
'allow_links',
)) && !empty($value)) {
if (!in_array($value, array(
1,
2,
))) {
$request->{$param} = NULL;
}
}
if (in_array($param, array(
'js_on',
)) && !empty($value)) {
if (!is_integer($value)) {
$request->{$param} = NULL;
}
}
if ($param == 'sender_ip' && !empty($value)) {
if (!is_string($value)) {
$request->{$param} = NULL;
}
}
if ($param == 'sender_email' && !empty($value)) {
if (!is_string($value)) {
$request->{$param} = NULL;
}
}
if ($param == 'submit_time' && !empty($value)) {
if (!is_int($value)) {
$request->{$param} = NULL;
}
}
}
return $request;
}