Preserve unicode characters in goals_criteria JSON encoding for department goals
This commit is contained in:
@@ -114,8 +114,8 @@ class departmentGoalsRoute
|
||||
}
|
||||
}
|
||||
|
||||
// Parse criteria
|
||||
$criteria = goals_criteria::fromJson(json_encode($criteriaInput));
|
||||
// Parse criteria (preserve unicode characters like æ, ø, å)
|
||||
$criteria = goals_criteria::fromJson(json_encode($criteriaInput, JSON_UNESCAPED_UNICODE));
|
||||
|
||||
// Create
|
||||
$goal = (new department_goals_o())->add($user, $departments, $criteria);
|
||||
@@ -185,7 +185,8 @@ class departmentGoalsRoute
|
||||
if ($response->isRequestParameterSet('criteria')) {
|
||||
$criteriaInput = self::getParameter('criteria');
|
||||
$this->requireTypeIn($criteriaInput, ['array', 'object']);
|
||||
$criteria = goals_criteria::fromJson(json_encode($criteriaInput));
|
||||
// Preserve unicode characters when (re)encoding criteria
|
||||
$criteria = goals_criteria::fromJson(json_encode($criteriaInput, JSON_UNESCAPED_UNICODE));
|
||||
$dataToUpdate['criteria'] = $criteria->toArray();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user