Skip to content

Commit 24113a3

Browse files
committed
fix(translation): avoid rn when using formatted rich (html) text
1 parent 93073e6 commit 24113a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

inc/translation.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ public function add(array $input) : bool {
228228
$type = $translatableStrings['id'][$input['id']];
229229
$original = $translatableStrings[$type][$input['id']];
230230

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

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

0 commit comments

Comments
 (0)