From 7c24b984ae49bc225a4d032a407a15836b8cce8d Mon Sep 17 00:00:00 2001
From: prasad <prasad@vtiger.com>
Date: Wed, 17 Feb 2016 20:20:53 +0530
Subject: [PATCH] Fixed: Escape of double quotes in CSV export.

---
 modules/Vtiger/actions/ExportData.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/Vtiger/actions/ExportData.php b/modules/Vtiger/actions/ExportData.php
index 737775290..d43d99546 100644
--- a/modules/Vtiger/actions/ExportData.php
+++ b/modules/Vtiger/actions/ExportData.php
@@ -176,6 +176,10 @@ class Vtiger_ExportData_Action extends Vtiger_Mass_Action {
 		echo $header;
 
 		foreach($entries as $row) {
+			// Escape double quotes in the value.
+			foreach ($row as $key => $value) {
+				$row[$key] = str_replace('"', '""', $value);
+			}
 			$line = implode("\",\"",$row);
 			$line = "\"" .$line;
 			$line .= "\"\r\n";
@@ -271,4 +275,4 @@ class Vtiger_ExportData_Action extends Vtiger_Mass_Action {
 		}
 		return $arr;
 	}
-}
\ No newline at end of file
+}
-- 
GitLab