Extra spaces patch for CSV exports

There are some carriage returns in some of the descriptions which was
throwing off the CSV cell assignment, so added a quick patch that
replaces said returns with a simple space to keep formatting intact
develop
Ro 1 year ago
parent a15db82697
commit 86652cc112
Signed by: are0h
GPG Key ID: 29B551CDBD4D3B50

@ -39,7 +39,11 @@ class ExportController extends Controller
$rate = $total / count($sources); $rate = $total / count($sources);
if ($rate * 100 >= $percent) { if ($rate * 100 >= $percent) {
if ($type == 'mastodon') { if ($type == 'mastodon') {
//comman break teh CSV so just take them out
$comments = str_replace(",", ";", $location->description); $comments = str_replace(",", ";", $location->description);
//remove extra white space
$comments = str_replace(["\n\r", "\n", "\r"], " ", $comments);
//add to the export list
array_push($list, [$location->url, $location->rating, $comments, "FALSE", "FALSE", "FALSE"]); array_push($list, [$location->url, $location->rating, $comments, "FALSE", "FALSE", "FALSE"]);
} }
} }

Loading…
Cancel
Save