From 86652cc11245d710e7c487a9274b3709cd25ee09 Mon Sep 17 00:00:00 2001 From: Ro Date: Thu, 28 Sep 2023 14:30:36 -0700 Subject: [PATCH] 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 --- app/Http/Controllers/ExportController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index fa57006..fcf17a6 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -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"]); } }