Skip to content

Commit 2b81b8f

Browse files
committed
Fixed: FS#1714 - Email autoresponder eliminates <newline>
1 parent 2786526 commit 2b81b8f

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

interface/lib/classes/tform.inc.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ function getHTML($record, $tab, $action = 'NEW') {
600600
* @param record = Datensatz als Array
601601
* @return record
602602
*/
603-
function encode($record,$tab) {
603+
function encode($record,$tab,$dbencode = true) {
604604
global $app;
605605

606606
if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab is empty or does not exist (TAB: $tab).");
@@ -614,14 +614,14 @@ function encode($record,$tab) {
614614
switch ($field['datatype']) {
615615
case 'VARCHAR':
616616
if(!@is_array($record[$key])) {
617-
$new_record[$key] = (isset($record[$key]))?$app->db->quote($record[$key]):'';
617+
$new_record[$key] = (isset($record[$key]))?$record[$key]:'';
618618
} else {
619619
$new_record[$key] = implode($field['separator'],$record[$key]);
620620
}
621621
break;
622622
case 'TEXT':
623623
if(!is_array($record[$key])) {
624-
$new_record[$key] = $app->db->quote($record[$key]);
624+
$new_record[$key] = $record[$key];
625625
} else {
626626
$new_record[$key] = implode($field['separator'],$record[$key]);
627627
}
@@ -658,7 +658,7 @@ function encode($record,$tab) {
658658
//if($key == 'refresh') die($record[$key]);
659659
break;
660660
case 'DOUBLE':
661-
$new_record[$key] = $app->db->quote($record[$key]);
661+
$new_record[$key] = $record[$key];
662662
break;
663663
case 'CURRENCY':
664664
$new_record[$key] = str_replace(",",".",$record[$key]);
@@ -686,8 +686,9 @@ function encode($record,$tab) {
686686
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
687687
}
688688
}
689-
690-
689+
690+
//* Add slashes to all records, when we encode data which shall be inserted into mysql.
691+
if($dbencode == true) $new_record[$key] = $app->db->quote($new_record[$key]);
691692
}
692693
}
693694
return $new_record;

interface/lib/classes/tform_actions.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ function onShowEdit() {
537537
if(!$record = $app->db->queryOneRecord($sql)) $app->error($app->lng('error_no_view_permission'));
538538
} else {
539539
// $record = $app->tform->encode($_POST,$this->active_tab);
540-
$record = $app->tform->encode($this->dataRecord,$this->active_tab);
540+
$record = $app->tform->encode($this->dataRecord,$this->active_tab,false);
541541
}
542542

543543
$this->dataRecord = $record;

0 commit comments

Comments
 (0)