]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #8652 from annando/annando/issue8582
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 17 May 2020 15:41:53 +0000 (11:41 -0400)
committerGitHub <noreply@github.com>
Sun, 17 May 2020 15:41:53 +0000 (11:41 -0400)
Issue 8582: "cid" in "network" is now "contactid"

src/Model/GServer.php

index bc189af9d6bb7567ff531884ed214a2aaaca44c9..f750ed99ea778b31034135c02850e3ad941c2622 100644 (file)
@@ -353,6 +353,15 @@ class GServer
                        return;
                }
 
+               // Sanitize incoming data, see https://github.com/friendica/friendica/issues/8565
+               $data['subscribe'] = (bool)$data['subscribe'] ?? false;
+
+               if (!$data['subscribe'] || empty($data['scope']) || !in_array(strtolower($data['scope']), ['all', 'tags'])) {
+                       $data['scope'] = '';
+                       $data['subscribe'] = false;
+                       $data['tags'] = [];
+               }
+
                $gserver = DBA::selectFirst('gserver', ['id', 'relay-subscribe', 'relay-scope'], ['nurl' => Strings::normaliseLink($server_url)]);
                if (!DBA::isResult($gserver)) {
                        return;