forked from GithubBackups/vichan
post.php: use IpBlacklistService to check for spam ips via DNS
This commit is contained in:
parent
9cfcf6e536
commit
d210f408dc
17
post.php
17
post.php
@ -8,7 +8,7 @@ require_once 'inc/bootstrap.php';
|
||||
use Vichan\{Context, WebDependencyFactory};
|
||||
use Vichan\Data\Driver\{LogDriver, HttpDriver};
|
||||
use Vichan\Data\ReportQueries;
|
||||
use Vichan\Service\{RemoteCaptchaQuery, SecureImageCaptchaQuery};
|
||||
use Vichan\Service\{IpBlacklistService, RemoteCaptchaQuery, SecureImageCaptchaQuery};
|
||||
use Vichan\Functions\{Format, IP};
|
||||
|
||||
/**
|
||||
@ -373,7 +373,10 @@ if (isset($_POST['delete'])) {
|
||||
}
|
||||
}
|
||||
|
||||
checkDNSBL();
|
||||
$blacklist = $context->get(IpBlacklistService::class)->isIpBlacklisted($_SERVER['REMOTE_ADDR']);
|
||||
if ($blacklist !== false) {
|
||||
error(\sprintf($config['error']['dnsbl'], $blacklist));
|
||||
}
|
||||
|
||||
// Check if board exists
|
||||
if (!openBoard($_POST['board']))
|
||||
@ -468,7 +471,10 @@ if (isset($_POST['delete'])) {
|
||||
}
|
||||
}
|
||||
|
||||
checkDNSBL();
|
||||
$blacklist = $context->get(IpBlacklistService::class)->isIpBlacklisted($_SERVER['REMOTE_ADDR']);
|
||||
if ($blacklist !== false) {
|
||||
error(\sprintf($config['error']['dnsbl'], $blacklist));
|
||||
}
|
||||
|
||||
// Check if board exists
|
||||
if (!openBoard($_POST['board']))
|
||||
@ -661,7 +667,10 @@ if (isset($_POST['delete'])) {
|
||||
(!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], rawurldecode($_SERVER['HTTP_REFERER']))))
|
||||
error($config['error']['referer']);
|
||||
|
||||
checkDNSBL();
|
||||
$blacklist = $context->get(IpBlacklistService::class)->isIpBlacklisted($_SERVER['REMOTE_ADDR']);
|
||||
if ($blacklist !== false) {
|
||||
error(\sprintf($config['error']['dnsbl'], $blacklist));
|
||||
}
|
||||
|
||||
|
||||
if ($post['mod'] = isset($_POST['mod']) && $_POST['mod']) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user