]> git.mxchange.org Git - friendica.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 26 May 2023 15:49:51 +0000 (17:49 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 17 Jan 2024 00:03:04 +0000 (01:03 +0100)
- 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 <roland@mxchange.org>
src/Model/GServer.php

index 0c839a78e186c8cddb4de0cbbb63061acfe60f58..8295a02ea538a2d8fe0b12c5e00e38c870b574ca 100644 (file)
@@ -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);