/
SNL.Examine.class.php
52 lines (42 loc) · 1.37 KB
/
SNL.Examine.class.php
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
<?php
/**
* File: SNL.Examine.class.php
* This is the Spam Number of Links Examine class for the Geeklog Spam-X plugin
* Copyright (C) 2006-2017 Tom Homer - WebSiteMaster AT cogeco DOT com
* Licensed under the GNU General Public License
*/
if (stripos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) {
die ('This file can not be used on its own!');
}
// Include Base Classes
require_once($_CONF['path'] . 'plugins/spamx/' . 'BaseCommand.class.php');
require_once($_CONF['path'] . 'plugins/spamx/' . 'SNLbase.class.php');
/**
* Checks number of links in post.
* based in large part on the works of Dirk Haun, Tom Willet (Spam-X) and Russ Jones (SLV)
*/
class SNL extends BaseCommand
{
/**
* Here we do the work
*
* @param string $comment
* @return int
*/
public function execute($comment)
{
global $LANG_SX00;
$ans = PLG_SPAM_NOT_FOUND;
$uid = $this->getUid();
$SNL = new SNLbase();
if ($SNL->CheckForSpam($comment)) {
$ans = PLG_SPAM_FOUND;
SPAMX_log($LANG_SX00['foundspam'] . 'Spam Number of Links (SNL)' .
$LANG_SX00['foundspam2'] . $uid .
$LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
}
// tell the Action module that we've already been triggered
$GLOBALS['SNL_triggered'] = true;
return $ans;
}
}