Skip to content

Commit

Permalink
fix import of complex structures
Browse files Browse the repository at this point in the history
q
  • Loading branch information
iszmais committed Jun 14, 2024
1 parent f851842 commit f952ece
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ public function importRecord(
string $a_schema_version
): void {
foreach ($a_rec as $key => &$value) {
$decode = json_decode($value);
$decode = json_decode($value, true);
if (is_array($decode)) {
foreach ($decode as &$entry) {
$entry = htmlspecialchars($entry, ENT_QUOTES | ENT_SUBSTITUTE, 'utf-8');
}
$value = json_encode($decode);
$value = htmlspecialchars(json_encode($decode, JSON_HEX_APOS | JSON_HEX_QUOT), ENT_SUBSTITUTE, 'utf-8');
} else {
if ($key === 'title' || $key === 'description') {
$value = strip_tags($value, ilObjectGUI::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION);
Expand Down

0 comments on commit f952ece

Please sign in to comment.