From: Michael Date: Sun, 19 Jan 2025 13:24:59 +0000 (+0000) Subject: Fix exception "Argument #2 ($jsonld) must be of type array, string given" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d42b31bee64814beeaa0ae5c6c3ff43da46b701f;p=friendica.git Fix exception "Argument #2 ($jsonld) must be of type array, string given" --- diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index 97ecdb977b..464d03c8d0 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -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); } }