Merge pull request #13709 from friendica/MrPetovan-patch-1

Add support for string in $nodeinfo['protocols']
This commit is contained in:
Michael Vogel 2023-12-10 19:59:38 +01:00 committed by GitHub
commit 2643ca11e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1266,9 +1266,13 @@ class GServer
if (!empty($nodeinfo['protocols'])) { if (!empty($nodeinfo['protocols'])) {
$protocols = []; $protocols = [];
foreach ($nodeinfo['protocols'] as $protocol) { if (is_string($nodeinfo['protocols'])) {
if (is_string($protocol)) { $protocols[$nodeinfo['protocols']] = true;
$protocols[$protocol] = true; } else {
foreach ($nodeinfo['protocols'] as $protocol) {
if (is_string($protocol)) {
$protocols[$protocol] = true;
}
} }
} }
@ -1367,9 +1371,13 @@ class GServer
if (!empty($nodeinfo['protocols'])) { if (!empty($nodeinfo['protocols'])) {
$protocols = []; $protocols = [];
foreach ($nodeinfo['protocols'] as $protocol) { if (is_string($nodeinfo['protocols'])) {
if (is_string($protocol)) { $protocols[$nodeinfo['protocols']] = true;
$protocols[$protocol] = true; } else {
foreach ($nodeinfo['protocols'] as $protocol) {
if (is_string($protocol)) {
$protocols[$protocol] = true;
}
} }
} }