From 4e02c347b63ab1be30e402f2224f74b1cd1e6ccf Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Aug 2022 04:14:39 +0000 Subject: [PATCH 1/2] Handle array --- src/Util/ParseUrl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index d0b168278..02ef6be58 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -1131,6 +1131,8 @@ class ParseUrl $content = JsonLD::fetchElement($jsonld, 'logo', 'url', '@type', 'ImageObject'); if (!empty($content) && is_string($content)) { $jsonldinfo['publisher_img'] = trim($content); + } elseif (!empty($content) && is_array($content)) { + $jsonldinfo['publisher_img'] = trim($content[0]); } $content = JsonLD::fetchElement($jsonld, 'brand', 'name', '@type', 'Organization'); From 3052ae71b74e45a6624797d0748313bbd0266c8d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Aug 2022 09:12:36 +0000 Subject: [PATCH 2/2] Avoid warnings --- src/Model/GServer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 08cefba56..9801ea9c6 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -2164,9 +2164,11 @@ class GServer if ($curlResult->isSuccess()) { $servers = json_decode($curlResult->getBody(), true); - foreach ($servers['instances'] as $server) { - $url = (is_null($server['https_score']) ? 'http' : 'https') . '://' . $server['name']; - self::add($url); + if (!empty($servers['instances'])) { + foreach ($servers['instances'] as $server) { + $url = (is_null($server['https_score']) ? 'http' : 'https') . '://' . $server['name']; + self::add($url); + } } } }