Skip to content

Commit

Permalink
Remove double spaces on CSV Export
Browse files Browse the repository at this point in the history
  • Loading branch information
Nayjest authored Jan 13, 2017
1 parent 0729102 commit d8514e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Components/CsvExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,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); # remove double spaces
$str = trim($str);
return $str;
}

/**
Expand Down

0 comments on commit d8514e4

Please sign in to comment.