From e47556e73eab6f86c67dda337da3ca666eebbf72 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Wed, 25 Feb 2026 12:10:32 +0100 Subject: [PATCH] Update core/csvbulkexport.class.inc.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- core/csvbulkexport.class.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/csvbulkexport.class.inc.php b/core/csvbulkexport.class.inc.php index 42b3a7ddb..0e4ded346 100644 --- a/core/csvbulkexport.class.inc.php +++ b/core/csvbulkexport.class.inc.php @@ -271,12 +271,13 @@ EOF $sRet = trim($oObj->GetAsCSV($sAttCode), '"'); } - // If the option to ignore Excel sanitization is set, return the raw value without sanitization - if (array_key_exists('ignore_excel_sanitization', $this->aStatusInfo) && $this->aStatusInfo['ignore_excel_sanitization'] === true) { - return $sRet; + // If the option to ignore Excel sanitization is not set or explicitly set to false, apply sanitization + if (!(array_key_exists('ignore_excel_sanitization', $this->aStatusInfo)) || $this->aStatusInfo['ignore_excel_sanitization'] === false) { + return ExportHelper::SanitizeField($sRet, $this->aStatusInfo['text_qualifier'] ?? ''); } - return ExportHelper::SanitizeField($sRet, $this->aStatusInfo['text_qualifier'] ?? ''); + // The option to ignore Excel sanitization is explicitly set to true: return the raw value without sanitization + return $sRet; } public function GetHeader()