Skip to content

Commit

Permalink
fix(translation): avoid rn when using formatted rich (html) text
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jan 30, 2023
1 parent 93073e6 commit 24113a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/translation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ public function add(array $input) : bool {
$type = $translatableStrings['id'][$input['id']];
$original = $translatableStrings[$type][$input['id']];

$translations[$original] = Toolbox::stripslashes_deep($input['value']);
$input['value'] = Sanitizer::unsanitize($input['value']);
$input['value'] = str_replace('\r\n', '', $input['value']);
$translations[$original] = Sanitizer::sanitize($input['value'], false);

if (!$form->setTranslations($formLanguage->fields['name'], $translations)) {
Session::addMessageAfterRedirect(__('Failed to add the translation.', 'formcreator'), false, ERROR);
Expand Down

0 comments on commit 24113a3

Please sign in to comment.