From 46110f0915346f8d4e49777badd7b6c8c9cf82ab Mon Sep 17 00:00:00 2001 From: Min-Soo Kim Date: Wed, 23 Dec 2020 09:54:46 +0900 Subject: [PATCH] Treat quotation mark --- common/framework/parsers/dbquery/variablebase.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/framework/parsers/dbquery/variablebase.php b/common/framework/parsers/dbquery/variablebase.php index 5063d2121..402d65a76 100644 --- a/common/framework/parsers/dbquery/variablebase.php +++ b/common/framework/parsers/dbquery/variablebase.php @@ -442,7 +442,14 @@ class VariableBase $where = ''; $params = array(); - // parse the value (text) + // flag to mark transformed quotation mark. + $escaped_quot = false; + // parse the value (text); + if (strpos ($value, '"')) + { + $escaped_quot = true; + $value = str_replace('"', '"', $value); + } $keywords = preg_split('/(\([^\)]*\))|("[^"]*")|[\s,]+/', trim($value), 10, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); $conditions = array(); $operators = array('AND', 'OR', '|'); @@ -475,6 +482,12 @@ class VariableBase continue; } + if($escaped_quot === true) + { + $value = str_replace('"', '"', $value); + $escaped_quot = false; + } + // process 'AND' or 'OR' operator if (in_array($item, $operators)) {