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=1a9ed768846b2672fddd6ed15a935a5f5d42c449;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 0c839a78e1..8295a02ea5 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -471,6 +471,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()]); @@ -561,6 +569,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);