Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Do not remove line breaks from mails sent with the form generator (#1959
Browse files Browse the repository at this point in the history
)
  • Loading branch information
leofeyer committed May 28, 2010
1 parent ff5362c commit 173ca70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions contao-2.9/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Version 2.9.RC1 (2010--)
- Fixed: corrected a few spelling mistakes and translation issues (#2032)
- Fixed: subpalettes were not inserted correctly when loaded via Ajax (#2039)
- Fixed: the DC_File driver did not support multi-text fields (#2045)
- Fixed: do not remove line breaks from mails sent with the form generator (#1959)
- Fixed a few minor issues

Version 2.9.beta1 (2010-05-17)
Expand Down
8 changes: 4 additions & 4 deletions contao-2.9/system/modules/frontend/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,23 @@ protected function processFormData($arrSubmitted)
}

// Add field to message
$message .= ucfirst($k) . ': ' . (is_array($v) ? implode(', ', $v) : preg_replace('/[\n\t\r]+/', ' ', $v)) . "\n";
$message .= ucfirst($k) . ': ' . (is_array($v) ? implode(', ', $v) : $v) . "\n";

// Prepare XML file
if ($this->format == 'xml')
{
$fields[] = array
(
'name' => $k,
'values' => (is_array($v) ? $v : array(preg_replace('/[\n\t\r]+/', ' ', $v)))
'values' => (is_array($v) ? $v : array($v))
);
}

// Prepare CSV file
if ($this->format == 'csv')
{
$keys[] = $k;
$values[] = (is_array($v) ? implode(',', $v) : preg_replace('/[\n\t\r]+/', ' ', $v));
$values[] = (is_array($v) ? implode(',', $v) : $v);
}
}

Expand Down Expand Up @@ -360,7 +360,7 @@ protected function processFormData($arrSubmitted)
// Attach CSV file
if ($this->format == 'csv')
{
$email->attachFileFromString($this->String->decodeEntities(implode(';', $keys) . "\n" . implode(';', $values)), 'form.csv', 'text/comma-separated-values');
$email->attachFileFromString($this->String->decodeEntities('"' . implode(';', $keys) . '"' . "\n" . '"' . implode('";"', $values) . '"'), 'form.csv', 'text/comma-separated-values');
}

$uploaded = '';
Expand Down

0 comments on commit 173ca70

Please sign in to comment.