From 302070875c1f9c32704a72ba77997df7602fd1d0 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 31 May 2021 00:47:03 -0400 Subject: [PATCH] Ensure nodeinfo-provided protocols are strings in Model\GServer::parseNodeinfo2 - https://github.com/friendica/friendica/issues/10168#issuecomment-828281803 --- src/Model/GServer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 6a1a363e34..7e1d178ddf 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -802,6 +802,7 @@ class GServer /** * Parses Nodeinfo 2 * + * @see https://git.feneas.org/jaywink/nodeinfo2 * @param string $nodeinfo_url address of the nodeinfo path * @return array Server data * @throws \Friendica\Network\HTTPException\InternalServerErrorException @@ -850,7 +851,9 @@ class GServer if (!empty($nodeinfo['protocols'])) { $protocols = []; foreach ($nodeinfo['protocols'] as $protocol) { - $protocols[$protocol] = true; + if (is_string($protocol)) { + $protocols[$protocol] = true; + } } if (!empty($protocols['dfrn'])) {