-
Notifications
You must be signed in to change notification settings - Fork 19
/
SLV.Examine.class.php
65 lines (57 loc) · 2.15 KB
/
SLV.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
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* File: SLV.Examine.class.php
* This is the Spam Link Verification Examine class for the Geeklog Spam-X plugin
* Copyright (C) 2006-2017 by the following authors:
* Author Dirk Haun dirk AT haun-online DOT de
* Licensed under the GNU General Public License
*
* @package Spam-X
* @subpackage Modules
*/
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/' . 'SLVbase.class.php';
/**
* Sends posts to SLV (linksleeve.org) for examination
*
* @author Dirk Haun dirk AT haun-online DOT de
* based on the works of Tom Willet (Spam-X) and Russ Jones (SLV)
* @package Spam-X
*/
class SLV extends BaseCommand
{
/**
* Here we do the work
*
* @param string $comment
* @param string $permanentLink (since GL 2.2.0)
* @param string $commentType (since GL 2.2.0)
* @param string $commentAuthor (since GL 2.2.0)
* @param string $commentAuthorEmail (since GL 2.2.0)
* @param string $commentAuthorURL (since GL 2.2.0)
* @return int either PLG_SPAM_NOT_FOUND, PLG_SPAM_FOUND or PLG_SPAM_UNSURE
* @note As for valid value for $commentType, see system/classes/Akismet.php
*/
public function execute($comment, $permanentLink = null, $commentType = Geeklog\Akismet::COMMENT_TYPE_COMMENT,
$commentAuthor = null, $commentAuthorEmail = null, $commentAuthorURL = null)
{
global $LANG_SX00;
$answer = PLG_SPAM_NOT_FOUND;
$uid = $this->getUid();
$slv = new SLVbase();
if ($slv->CheckForSpam($comment)) {
$answer = PLG_SPAM_FOUND;
SPAMX_log($LANG_SX00['foundspam'] . 'Spam Link Verification (SLV)' .
$LANG_SX00['foundspam2'] . $uid .
$LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']
);
}
// tell the Action module that we've already been triggered
$GLOBALS['slv_triggered'] = true;
return $answer;
}
}