Treat quotation mark

This commit is contained in:
Min-Soo Kim 2020-12-23 09:54:46 +09:00
parent a247ec8335
commit 46110f0915

View file

@ -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))
{