]> git.mxchange.org Git - friendica.git/commitdiff
Ensure nodeinfo-provided protocols are strings in Model\GServer::parseNodeinfo2
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 31 May 2021 04:47:03 +0000 (00:47 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 31 May 2021 04:47:03 +0000 (00:47 -0400)
- https://github.com/friendica/friendica/issues/10168#issuecomment-828281803

src/Model/GServer.php

index 6a1a363e34f96580d991d74b6a8294e2d63715fd..7e1d178ddfe1bf6986f36cc9464b00b95f165148 100644 (file)
@@ -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'])) {