Skip to content

Commit

Permalink
Merge pull request #29 from S-anasol/patch-1
Browse files Browse the repository at this point in the history
Removing double spaces and new lines from CSV
  • Loading branch information
Nayjest authored Jan 13, 2017
2 parents d000cab + ffec129 commit 846616d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Component/CsvExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ protected function renderCsv()

protected function escapeString($str)
{
return str_replace('"', '\'', strip_tags(html_entity_decode($str)));
$str = html_entity_decode($str);
$str = strip_tags($str);
$str = str_replace('"', '\'', $str);
$str = preg_replace('/\s+/', ' ', $str);
$str = trim($str);
return $str;
}

/**
Expand Down

0 comments on commit 846616d

Please sign in to comment.