From d42b31bee64814beeaa0ae5c6c3ff43da46b701f Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 19 Jan 2025 13:24:59 +0000 Subject: [PATCH] Fix exception "Argument #2 ($jsonld) must be of type array, string given" --- src/Util/ParseUrl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } }