From 6a434588a97799abc827332aa9268f5a8bc0a897 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 24 Nov 2022 05:17:14 +0000 Subject: [PATCH 1/3] Silently quit on unfollow of invalid contacts --- src/Core/Protocol.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Core/Protocol.php b/src/Core/Protocol.php index 015612adea..511954c7f9 100644 --- a/src/Core/Protocol.php +++ b/src/Core/Protocol.php @@ -182,7 +182,8 @@ class Protocol public static function unfollow(array $contact, array $user): ?bool { if (empty($contact['network'])) { - throw new \InvalidArgumentException('Missing network key in contact array'); + Logger::notice('Contact has got no network, we quit here', ['id' => $contact['id']]); + return true; } $protocol = $contact['network']; @@ -205,7 +206,8 @@ class Protocol $slap = OStatus::salmon($item, $user); if (empty($contact['notify'])) { - throw new \InvalidArgumentException('Missing expected "notify" key in OStatus/DFRN contact'); + Logger::notice('OStatus/DFRN Contact is missing notify, we quit here', ['id' => $contact['id']]); + return true; } return Salmon::slapper($user, $contact['notify'], $slap) === 0; From 53b46855ef2d8c42787e03e7d1fd047e68765ad1 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 24 Nov 2022 19:45:45 +0000 Subject: [PATCH 2/3] return "null" --- src/Core/Protocol.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Protocol.php b/src/Core/Protocol.php index 511954c7f9..25955abd50 100644 --- a/src/Core/Protocol.php +++ b/src/Core/Protocol.php @@ -183,7 +183,7 @@ class Protocol { if (empty($contact['network'])) { Logger::notice('Contact has got no network, we quit here', ['id' => $contact['id']]); - return true; + return null; } $protocol = $contact['network']; @@ -207,7 +207,7 @@ class Protocol if (empty($contact['notify'])) { Logger::notice('OStatus/DFRN Contact is missing notify, we quit here', ['id' => $contact['id']]); - return true; + return null; } return Salmon::slapper($user, $contact['notify'], $slap) === 0; From 32eb50506d127de0699873234f41ee1d49bb5bfd Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Thu, 24 Nov 2022 23:07:27 +0100 Subject: [PATCH 3/3] Update mods/sample-nginx-certbot.config Damn typos, I am too used to use autocorrect, need to learn again to proofread my own texts! Thank you very much! <3 Co-authored-by: Philipp --- mods/sample-nginx-certbot.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/sample-nginx-certbot.config b/mods/sample-nginx-certbot.config index e0b6073ba4..a116a66dd3 100644 --- a/mods/sample-nginx-certbot.config +++ b/mods/sample-nginx-certbot.config @@ -1,6 +1,6 @@ ## -# Friendica Nginx configuration template to be autocnfgiured with cerbot -# nased on sample-nginx.config by Olaf Conradi +# Friendica Nginx configuration template to be autoconfigured with certbot +# based on sample-nginx.config by Olaf Conradi # # On Debian based distributions you can add this file to # /etc/nginx/sites-available