From: Roland Häder Date: Fri, 26 May 2023 15:49:51 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=36758323bcfadea0be39db15789dcccbe1e2c89d;p=friendica.git Continued: - someone removed these checks, if the GServer's url is blocked, flooders like activitypub-troll.cf will then be able to flood your gserver table again Signed-off-by: Roland Häder --- diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 0a62c77e36..f9b6e0f42f 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -486,6 +486,14 @@ class GServer return; } + if (Network::isUrlBlocked($url)) { + Logger::info('Server domain is blocked', ['url' => $url]); + return; + } elseif (Network::isUrlBlocked($nurl)) { + Logger::info('Server domain is blocked', ['nurl' => $nurl]); + return; + } + self::insert(['url' => $url, 'nurl' => $nurl, 'network' => Protocol::PHANTOM, 'created' => DateTimeFormat::utcNow(), 'failed' => true, 'last_failure' => DateTimeFormat::utcNow()]); @@ -576,6 +584,9 @@ class GServer self::detect($url, $network, $only_nodeinfo); } return false; + } elseif (Network::isUrlBlocked($url)) { + Logger::info('Server domain is blocked', ['url' => $url]); + return false; } $valid_url = Network::isUrlValid($url);