From f1e2ceb32c40f653759987f0f15be0a0672748c9 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 2 Oct 2021 10:25:50 +0000 Subject: [PATCH] Issue 10747: Improved check for blocked domains --- src/Model/APContact.php | 3 ++- src/Network/Probe.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Model/APContact.php b/src/Model/APContact.php index 13add7e658..a919a67f30 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -119,7 +119,8 @@ class APContact */ public static function getByURL($url, $update = null) { - if (empty($url)) { + if (empty($url) || Network::isUrlBlocked($url)) { + Logger::info('Domain is blocked', ['url' => $url]); return []; } diff --git a/src/Network/Probe.php b/src/Network/Probe.php index bb805b2d05..4aa50b4be5 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -231,6 +231,11 @@ class Probe } } + if (Network::isUrlBlocked($host_url)) { + Logger::info('Domain is blocked', ['url' => $host]); + return []; + } + self::$baseurl = $host_url; Logger::info('Probing successful', ['host' => $host]); @@ -625,6 +630,11 @@ class Probe */ private static function getWebfinger(string $template, string $type, string $uri, string $addr) { + if (Network::isUrlBlocked($template)) { + Logger::info('Domain is blocked', ['url' => $template]); + return []; + } + // First try the address because this is the primary purpose of webfinger if (!empty($addr)) { $detected = $addr;