From 5dcdc4d639cc0982c92431648e50d79251baa0ca Mon Sep 17 00:00:00 2001 From: Saurabh Batra Date: Tue, 12 Apr 2016 10:50:53 +0530 Subject: [PATCH] =?utf8?q?CRM-17859=20-=20import=20contacts=20from=20CSV:?= =?utf8?q?=20sanitise=20/=20cleanup=20non-breaking=E2=80=A6=20(#7813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * CRM-17859 - import contacts from CSV: sanitise / cleanup non-breaking spaces from records https://issues.civicrm.org/jira/browse/CRM-17859 * Update String.php --- CRM/Import/DataSource/CSV.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CRM/Import/DataSource/CSV.php b/CRM/Import/DataSource/CSV.php index 6d7d6dd033..89c7f22cc0 100644 --- a/CRM/Import/DataSource/CSV.php +++ b/CRM/Import/DataSource/CSV.php @@ -229,6 +229,12 @@ class CRM_Import_DataSource_CSV extends CRM_Import_DataSource { } $first = FALSE; + + // CRM-17859 Trim non-breaking spaces from columns. + $row = array_map( + function($string) { + return trim($string, chr(0xC2) . chr(0xA0)); + }, $row); $row = array_map('civicrm_mysql_real_escape_string', $row); $sql .= "('" . implode("', '", $row) . "')"; $count++; -- 2.25.1