From 2f0c31f2ea9c2d3216aaf457a95359b774101b21 Mon Sep 17 00:00:00 2001 From: Tony Qu Date: Tue, 30 Sep 2025 08:50:40 +0800 Subject: [PATCH] fix #1369 --- ooxml/XSSF/UserModel/XSSFDataValidationConstraint.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ooxml/XSSF/UserModel/XSSFDataValidationConstraint.cs b/ooxml/XSSF/UserModel/XSSFDataValidationConstraint.cs index 7f5a39a2b..7aea233f8 100644 --- a/ooxml/XSSF/UserModel/XSSFDataValidationConstraint.cs +++ b/ooxml/XSSF/UserModel/XSSFDataValidationConstraint.cs @@ -20,6 +20,7 @@ limitations under the License. using NPOI.Util; using NPOI.OpenXmlFormats.Spreadsheet; using System.Text.RegularExpressions; +using NPOI.OpenXml4Net.Util; namespace NPOI.XSSF.UserModel { @@ -127,7 +128,7 @@ public String[] ExplicitListValues { builder.Append(LIST_SEPARATOR); } - builder.Append(string1); + builder.Append(XmlHelper.EncodeCDATAContent(string1)); } builder.Append(QUOTE); Formula1 = builder.ToString();