diff Resources/Orthanc/Databases/ISqlLookupFormatter.cpp @ 353:389c037387ea

Escaping '[' & ']' (change necessary only for MSSQL but this does not impact PG and MySQL plugins that were already matching angle brackets correctly)
author Alain Mazy <am@osimis.io>
date Mon, 15 Nov 2021 12:22:44 +0100
parents f2e160b2dc3e
children 2a3bbb4104fa
line wrap: on
line diff
--- a/Resources/Orthanc/Databases/ISqlLookupFormatter.cpp	Thu Aug 12 13:27:41 2021 +0200
+++ b/Resources/Orthanc/Databases/ISqlLookupFormatter.cpp	Mon Nov 15 12:22:44 2021 +0100
@@ -172,6 +172,14 @@
             {
               escaped += "_";
             }
+            else if (value[i] == '[')
+            {
+              escaped += "\\[";
+            }
+            else if (value[i] == ']')
+            {
+              escaped += "\\]";
+            }
             else if (value[i] == '%')
             {
               escaped += "\\%";