From eeffaaaa6938a9a2e871fb7e58daa59427f40da0 Mon Sep 17 00:00:00 2001 From: yxia2ufl <149628256+yxia2ufl@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:43:59 -0500 Subject: [PATCH] issue442_escape_explicitly Signed-off-by: yxia2 --- .../src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java b/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java index 084eda24..945fb3fb 100755 --- a/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java +++ b/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java @@ -69,7 +69,12 @@ public static String getClobStringWithLinebreak(Clob clob) throws SQLException, */ public static String escapeSingleQuote(String x) { - return escapeSingleQuote(x, false); + return escapeSingleQuote(x, false) + // In some cases it still got unescaped single quote. + // e.g. during node drag and drop operation when the node name contains a single quote. + // Therefore, we handle it explicitly to make sure there is no unescaped single quote. + .replace("'", "''") // replace all, regardless. + .replace("''''", "''"); // change back for those that were escaped twice. }