From: Hypolite Petovan Date: Sat, 9 Dec 2023 20:34:15 +0000 (-0500) Subject: Add support for string in $nodeinfo['protocols'] X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=35e3e912df957fe6ed78b670bae5f5442289e7dd;p=friendica.git Add support for string in $nodeinfo['protocols'] - Address https://github.com/friendica/friendica/issues/13157#issuecomment-1848404671 --- diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 432914e178..9d913f1c12 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -1266,9 +1266,13 @@ class GServer if (!empty($nodeinfo['protocols'])) { $protocols = []; - foreach ($nodeinfo['protocols'] as $protocol) { - if (is_string($protocol)) { - $protocols[$protocol] = true; + if (is_string($nodeinfo['protocols'])) { + $protocols[$nodeinfo['protocols']] = true; + } else { + foreach ($nodeinfo['protocols'] as $protocol) { + if (is_string($protocol)) { + $protocols[$protocol] = true; + } } } @@ -1367,9 +1371,13 @@ class GServer if (!empty($nodeinfo['protocols'])) { $protocols = []; - foreach ($nodeinfo['protocols'] as $protocol) { - if (is_string($protocol)) { - $protocols[$protocol] = true; + if (is_string($nodeinfo['protocols'])) { + $protocols[$nodeinfo['protocols']] = true; + } else { + foreach ($nodeinfo['protocols'] as $protocol) { + if (is_string($protocol)) { + $protocols[$protocol] = true; + } } }