From c31a2368a5fa00752c37c213ea7d64fc48c22511 Mon Sep 17 00:00:00 2001 From: Thomas Jakobi Date: Tue, 4 Apr 2023 17:27:26 +0200 Subject: [PATCH] Check if the JSON can be decoded to fix an issue that occurs in PHP 8+ --- .../mapstv/elements/snippets/JSONtoChunk.snippet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/components/mapstv/elements/snippets/JSONtoChunk.snippet.php b/core/components/mapstv/elements/snippets/JSONtoChunk.snippet.php index f949f83..f3cd987 100644 --- a/core/components/mapstv/elements/snippets/JSONtoChunk.snippet.php +++ b/core/components/mapstv/elements/snippets/JSONtoChunk.snippet.php @@ -10,10 +10,10 @@ */ $output = $input; $array = $modx->fromJSON($input); -if (count($array) > 0) { +if ($array && count($array) > 0) { $chunk = $modx->getObject('modChunk', array('name' => $options)); if ($chunk) { $output = $chunk->process($array); } } -return $output; \ No newline at end of file +return $output;