Add support for string in $nodeinfo['protocols']
- Address https://github.com/friendica/friendica/issues/13157#issuecomment-1848404671
This commit is contained in:
@@ -1266,11 +1266,15 @@ class GServer
|
|||||||
|
|
||||||
if (!empty($nodeinfo['protocols'])) {
|
if (!empty($nodeinfo['protocols'])) {
|
||||||
$protocols = [];
|
$protocols = [];
|
||||||
|
if (is_string($nodeinfo['protocols'])) {
|
||||||
|
$protocols[$nodeinfo['protocols']] = true;
|
||||||
|
} else {
|
||||||
foreach ($nodeinfo['protocols'] as $protocol) {
|
foreach ($nodeinfo['protocols'] as $protocol) {
|
||||||
if (is_string($protocol)) {
|
if (is_string($protocol)) {
|
||||||
$protocols[$protocol] = true;
|
$protocols[$protocol] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($protocols['dfrn'])) {
|
if (!empty($protocols['dfrn'])) {
|
||||||
$server['network'] = Protocol::DFRN;
|
$server['network'] = Protocol::DFRN;
|
||||||
@@ -1367,11 +1371,15 @@ class GServer
|
|||||||
|
|
||||||
if (!empty($nodeinfo['protocols'])) {
|
if (!empty($nodeinfo['protocols'])) {
|
||||||
$protocols = [];
|
$protocols = [];
|
||||||
|
if (is_string($nodeinfo['protocols'])) {
|
||||||
|
$protocols[$nodeinfo['protocols']] = true;
|
||||||
|
} else {
|
||||||
foreach ($nodeinfo['protocols'] as $protocol) {
|
foreach ($nodeinfo['protocols'] as $protocol) {
|
||||||
if (is_string($protocol)) {
|
if (is_string($protocol)) {
|
||||||
$protocols[$protocol] = true;
|
$protocols[$protocol] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($protocols['dfrn'])) {
|
if (!empty($protocols['dfrn'])) {
|
||||||
$server['network'] = Protocol::DFRN;
|
$server['network'] = Protocol::DFRN;
|
||||||
|
|||||||
Reference in New Issue
Block a user