Commit 2b81b8f6 authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#1714 - Email autoresponder eliminates <newline>

parent 27865260
...@@ -600,7 +600,7 @@ class tform { ...@@ -600,7 +600,7 @@ class tform {
* @param record = Datensatz als Array * @param record = Datensatz als Array
* @return record * @return record
*/ */
function encode($record,$tab) { function encode($record,$tab,$dbencode = true) {
global $app; global $app;
if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab is empty or does not exist (TAB: $tab)."); if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab is empty or does not exist (TAB: $tab).");
...@@ -614,14 +614,14 @@ class tform { ...@@ -614,14 +614,14 @@ class tform {
switch ($field['datatype']) { switch ($field['datatype']) {
case 'VARCHAR': case 'VARCHAR':
if(!@is_array($record[$key])) { if(!@is_array($record[$key])) {
$new_record[$key] = (isset($record[$key]))?$app->db->quote($record[$key]):''; $new_record[$key] = (isset($record[$key]))?$record[$key]:'';
} else { } else {
$new_record[$key] = implode($field['separator'],$record[$key]); $new_record[$key] = implode($field['separator'],$record[$key]);
} }
break; break;
case 'TEXT': case 'TEXT':
if(!is_array($record[$key])) { if(!is_array($record[$key])) {
$new_record[$key] = $app->db->quote($record[$key]); $new_record[$key] = $record[$key];
} else { } else {
$new_record[$key] = implode($field['separator'],$record[$key]); $new_record[$key] = implode($field['separator'],$record[$key]);
} }
...@@ -658,7 +658,7 @@ class tform { ...@@ -658,7 +658,7 @@ class tform {
//if($key == 'refresh') die($record[$key]); //if($key == 'refresh') die($record[$key]);
break; break;
case 'DOUBLE': case 'DOUBLE':
$new_record[$key] = $app->db->quote($record[$key]); $new_record[$key] = $record[$key];
break; break;
case 'CURRENCY': case 'CURRENCY':
$new_record[$key] = str_replace(",",".",$record[$key]); $new_record[$key] = str_replace(",",".",$record[$key]);
...@@ -686,8 +686,9 @@ class tform { ...@@ -686,8 +686,9 @@ class tform {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
} }
} }
//* Add slashes to all records, when we encode data which shall be inserted into mysql.
if($dbencode == true) $new_record[$key] = $app->db->quote($new_record[$key]);
} }
} }
return $new_record; return $new_record;
......
...@@ -537,7 +537,7 @@ class tform_actions { ...@@ -537,7 +537,7 @@ class tform_actions {
if(!$record = $app->db->queryOneRecord($sql)) $app->error($app->lng('error_no_view_permission')); if(!$record = $app->db->queryOneRecord($sql)) $app->error($app->lng('error_no_view_permission'));
} else { } else {
// $record = $app->tform->encode($_POST,$this->active_tab); // $record = $app->tform->encode($_POST,$this->active_tab);
$record = $app->tform->encode($this->dataRecord,$this->active_tab); $record = $app->tform->encode($this->dataRecord,$this->active_tab,false);
} }
$this->dataRecord = $record; $this->dataRecord = $record;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment