From 92ddd04ba0c4bfde46c69f3ecb996cd5f80a4b8c Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 17 Nov 2021 15:58:52 +0100 Subject: [PATCH] fix: [JSON fields] fixed escaping issues --- templates/element/genericElements/IndexTable/Fields/json.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/element/genericElements/IndexTable/Fields/json.php b/templates/element/genericElements/IndexTable/Fields/json.php index 6c14248..2aca821 100644 --- a/templates/element/genericElements/IndexTable/Fields/json.php +++ b/templates/element/genericElements/IndexTable/Fields/json.php @@ -1,9 +1,12 @@ Hash->extract($row, $field['data_path'])); + $data = $this->Hash->extract($row, $field['data_path']); // I feed dirty for this... if (is_array($data) && count($data) === 1 && isset($data[0])) { $data = $data[0]; } + if (!is_array($data)) { + $data = json_decode($data, true); + } echo sprintf( '
', h($k)