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
This commit is contained in:
Ro 2023-09-28 14:30:36 -07:00
parent a15db82697
commit 86652cc112
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50

View file

@ -39,7 +39,11 @@ class ExportController extends Controller
$rate = $total / count($sources);
if ($rate * 100 >= $percent) {
if ($type == 'mastodon') {
//comman break teh CSV so just take them out
$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"]);
}
}