@@ -161,7 +161,7 @@ public static function getEditorFieldsHtml(PluginFormcreatorForm_Language $formL
161161 if (!isset ($ translatableString ['id ' ][$ id ])) {
162162 // Show nothing if string definitively not found
163163 // Should not happen
164- return '' ;
164+ return '<td colspan="2"> ' . __ ( ' Iternal error : translatable string not found. ' , ' formcreator ' ) . ' </td> ' ; ;
165165 }
166166
167167 $ type = $ translatableString ['id ' ][$ id ] ?? 'string ' ;
@@ -174,12 +174,12 @@ public static function getEditorFieldsHtml(PluginFormcreatorForm_Language $formL
174174 switch ($ type ) {
175175 case 'itemlink ' :
176176 case 'string ' :
177- $ out .= '<td> ' . $ original . Html::hidden ("id " , ['value ' => $ id ]) . '</td> ' ;
177+ $ out .= '<td width="50%" > ' . $ original . Html::hidden ("id " , ['value ' => $ id ]) . '</td> ' ;
178178 $ out .= '<td> ' . Html::input ("value " , ['value ' => $ translatedString ]) . '</td> ' ;
179179 break ;
180180
181181 case 'text ' :
182- $ out .= '<td> ' . Html::entity_decode_deep ($ original ) . Html::hidden ("id " , ['value ' => $ id ]) . '</td> ' ;
182+ $ out .= '<td width="50%" > ' . Html::entity_decode_deep ($ original ) . Html::hidden ("id " , ['value ' => $ id ]) . '</td> ' ;
183183 $ out .= '<td> ' . Html::textarea ([
184184 'name ' => "value " ,
185185 'value ' => $ translatedString ,
@@ -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