From c8dbf279feae85db4513caaaabf18b5c84d1c411 Mon Sep 17 00:00:00 2001 From: TLWebdesign Date: Thu, 5 Aug 2021 16:51:02 +0200 Subject: [PATCH] Add JSON Check and decode before checking if it is an array. fixes #786 --- admin/helpers/compiler/e_Interpretation.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index d9229b9a3..ec5f71192 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -4343,8 +4343,14 @@ class Interpretation extends Fields . $this->setLine(__LINE__) . " Check if \$" . $default['on_field'] . " is an array with values."; - $methods .= PHP_EOL . $this->_t(2) . "\$array = \$" - . $default['on_field'] . ";"; + $methods .= PHP_EOL . $this->_t(2) . "\$array = (" + . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] + . "Helper::checkJson(\$" + . $default['on_field'] + . ", true)) ? json_decode(\$" + . $default['on_field'] . ",true) : \$" + . $default['on_field'] . ";"; $methods .= PHP_EOL . $this->_t(2) . "if (isset(\$array) && " . $this->fileContentStatic[$this->hhh