From 21bf8cdaca359a96e26a4960a60ce56d055b37bb Mon Sep 17 00:00:00 2001 From: Min-Soo Kim Date: Sun, 27 Dec 2020 19:54:28 +0900 Subject: [PATCH] code refining2 --- common/framework/parsers/dbquery/variablebase.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/framework/parsers/dbquery/variablebase.php b/common/framework/parsers/dbquery/variablebase.php index c93c91ea5..52a0793cc 100644 --- a/common/framework/parsers/dbquery/variablebase.php +++ b/common/framework/parsers/dbquery/variablebase.php @@ -451,7 +451,7 @@ class VariableBase // parse the value (text); $value = str_replace('"', '"', $value); - $keywords = preg_split('/(\([^\)]*\))|(\-?"[^"]*")|[\s,]+/', trim($value), 10, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); + $keywords = preg_split('/(\([^\)]*\))|(\-?\"[^\"]*\")|[\s,]+/', trim($value), 10, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); $conditions = array(); $operators = array('AND', 'OR', '|'); // loop the parsed keywords or operators @@ -484,9 +484,9 @@ class VariableBase } else { - $value = str_replace('"', '"', $value); + $item = str_replace('"', '"', $item); - if (substr($item, 0, 1) === '-' && $escaped_hyphen !== true) + if (substr($item, 0, 1) === '-') { $conditions[] = sprintf('%s NOT LIKE ?', $column); $item = substr($item, 1); @@ -500,7 +500,6 @@ class VariableBase if (substr($item, 0, 6) === substr($item, -6) && substr($item, -6) === '"') { $item = substr($item, 6, -6); - } // pass blank text