Skip to content

Commit

Permalink
fix: [JSON fields] fixed escaping issues
Browse files Browse the repository at this point in the history
  • Loading branch information
iglocska committed Nov 17, 2021
1 parent ff77af0 commit 92ddd04
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/element/genericElements/IndexTable/Fields/json.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php
$data = h($this->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(
'<div class="json_container_%s"></div>',
h($k)
Expand Down

0 comments on commit 92ddd04

Please sign in to comment.