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 99c145f commit ead2f26
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,11 @@ 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 = $this->refinery->encode()->htmlAttributeValue()->transform($value);
}
$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);
} else {
$value = $this->refinery->encode()->htmlAttributeValue()->transform($value);
}
$value = $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform($value);
}
}
switch ($a_entity) {
Expand Down

0 comments on commit ead2f26

Please sign in to comment.