Skip to content

Commit 201e28d

Browse files
authored
fix: backslashes in translations not working in textarea (#3575)
* fix: backslashes in translations not working in textarea * fix: backslashes in translations not working in textarea * fix TU * fix: TU * fix tu * refactor * refactor * fix lint * lint
1 parent cdc5548 commit 201e28d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

inc/question.class.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ public function prepareInputForAdd($input) {
405405
if (!$this->skipChecks) {
406406
$input = $this->checkBeforeSave($input);
407407

408+
if (!empty($input['default_values'] && $input['fieldtype'] === 'textarea')) {
409+
$input['default_values'] = str_replace('\r\n', '', $input['default_values']);
410+
}
411+
408412
if (!$this->checkConditionSettings($input)) {
409413
$input['show_rule'] = PluginFormcreatorCondition::SHOW_RULE_ALWAYS;
410414
}
@@ -459,6 +463,12 @@ public function prepareInputForUpdate($input) {
459463

460464
$input = $this->checkBeforeSave($input);
461465

466+
if (!empty($input['default_values']) &&
467+
($input['fieldtype'] === 'textarea' || $this->fields['fieldtype'] === 'textarea')
468+
) {
469+
$input['default_values'] = str_replace('\r\n', '', $input['default_values']);
470+
}
471+
462472
if (!$this->checkConditionSettings($input)) {
463473
$input['show_rule'] = PluginFormcreatorCondition::SHOW_RULE_ALWAYS;
464474
}

0 commit comments

Comments
 (0)