From d3b967991846ab536cf8490889fa5c0a5f2330a9 Mon Sep 17 00:00:00 2001 From: Banana Date: Wed, 22 Nov 2023 14:39:46 +0100 Subject: [PATCH] fixed changed json path from google pagespeedonline --- ChangeLog | 1 + webroot/lib/snapshot.class.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5bff93d..d6512ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ version 2.x.x - Griffin Chapel () + Added TIMEZONE as a new config setting. Please update your config. See update.txt for more details. + + Snapshot json result from Google changed. Fixed. + Better logging + New home screen layout diff --git a/webroot/lib/snapshot.class.php b/webroot/lib/snapshot.class.php index 46b5280..bfbdc73 100644 --- a/webroot/lib/snapshot.class.php +++ b/webroot/lib/snapshot.class.php @@ -68,8 +68,8 @@ class Snapshot { if(DEBUG) { Summoner::sysLog("[DEBUG] Call result data: ".Summoner::cleanForLog($jsonData)); } - if(!empty($jsonData) && isset($jsonData['lighthouseResult']['audits']['full-page-screenshot']['details']['screenshot']['data'])) { - $imageData = $jsonData['lighthouseResult']['audits']['full-page-screenshot']['details']['screenshot']['data']; + if(!empty($jsonData) && isset($jsonData['lighthouseResult']['fullPageScreenshot']['screenshot']['data'])) { + $imageData = $jsonData['lighthouseResult']['fullPageScreenshot']['screenshot']['data']; $source = fopen($imageData, 'r'); $destination = fopen($filename, 'w'); @@ -79,7 +79,7 @@ class Snapshot { fclose($source); fclose($destination); } elseif(DEBUG) { - Summoner::sysLog("[DEBUG] invalid json data. Path ['lighthouseResult']['audits']['full-page-screenshot']['details']['screenshot']['data'] not found in : ".Summoner::cleanForLog($jsonData)); + Summoner::sysLog("[DEBUG] invalid json data. Path ['lighthouseResult']['fullPageScreenshot']['screenshot']['data'] not found in : ".Summoner::cleanForLog($jsonData)); } } elseif(DEBUG) { Summoner::sysLog("[DEBUG] curl call failed ".Summoner::cleanForLog($theCall)); -- 2.39.5