]> git.mxchange.org Git - friendica.git/commitdiff
Fix exception "Argument #2 ($jsonld) must be of type array, string given"
authorMichael <heluecht@pirati.ca>
Sun, 19 Jan 2025 13:24:59 +0000 (13:24 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 19 Jan 2025 13:24:59 +0000 (13:24 +0000)
src/Util/ParseUrl.php

index 97ecdb977b88522fd3549102ba65adf9676bd37f..464d03c8d0c634973f055e47fa17b4bc2fb1e372 100644 (file)
@@ -455,7 +455,8 @@ class ParseUrl
                $list = $xpath->query("//script[@type='application/ld+json']");
                foreach ($list as $node) {
                        if (!empty($node->nodeValue)) {
-                               if ($jsonld = json_decode($node->nodeValue, true)) {
+                               $jsonld = json_decode($node->nodeValue, true);
+                               if (is_array($jsonld)) {
                                        $siteinfo = self::parseParts($siteinfo, $jsonld);
                                }
                        }