From 074cda7fe4d111df28c91cfc02ae63760cdde2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 11 Aug 2018 22:32:30 +0200 Subject: [PATCH] trim all fields when importing via CSV. spaces are rarely intentional --- app/Tables/Changeset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Tables/Changeset.php b/app/Tables/Changeset.php index ad2aabd..7227eea 100644 --- a/app/Tables/Changeset.php +++ b/app/Tables/Changeset.php @@ -591,7 +591,7 @@ class Changeset // try to stop people inserting unstructured crap / malformed CSV throw new NotApplicableException("Value for column {$col->name} too long."); } - $data[$col->id] = $col->cast($val); + $data[$col->id] = $col->cast(trim($val)); } if ($forTableInsert) {