-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathNewsletter.php
More file actions
55 lines (50 loc) · 1.46 KB
/
Newsletter.php
File metadata and controls
55 lines (50 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Cleantalk\Antispam\Integrations;
use Cleantalk\ApbctWP\Variables\Post;
use Cleantalk\ApbctWP\Variables\Request;
class Newsletter extends IntegrationBase
{
/**
* @inheritDoc
*/
public function getDataForChecking($argument)
{
if ( Request::getString('nhr') ) {
// Prevent double redundant requests - this is the `success redirect` request
return null;
}
if (
$argument === 's' ||
$argument === 'subscribe' ||
$argument === 'sa' ||
$argument === 'ajaxsub'
) {
$posted = stripslashes_deep($_REQUEST);
$email = $posted['ne'];
$name = '';
if (isset($posted['nn'])) {
$name = $posted['nn'];
unset($posted['nn']);
}
if (isset($posted['ns'])) {
$name .= ' ' . $posted['ns'];
unset($posted['ns']);
}
$data = ct_gfa_dto(apply_filters('apbct__filter_post', $posted), $email, $name)->getArray();
if ( Post::getString('ct_bot_detector_event_token') ) {
$data['event_token'] = Post::get('ct_bot_detector_event_token');
}
return $data;
}
return null;
}
/**
* @inheritDoc
*/
public function doBlock($message)
{
global $ct_comment;
$ct_comment = $message;
ct_die($message, 403);
}
}