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;
+ }
}
}
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;
+ }
}
}