mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
따옴표 내의 빼기 기호는 의미를 부여하지 않도록 수정
This commit is contained in:
parent
8e48abd0db
commit
e86b2ec311
1 changed files with 10 additions and 2 deletions
|
|
@ -445,6 +445,10 @@ class VariableBase
|
|||
|
||||
// flag to mark transformed quotation mark.
|
||||
$escaped_quot = false;
|
||||
|
||||
// flag to mark escaped hypen in the quotation block
|
||||
$escaped_hyphen = false;
|
||||
|
||||
// parse the value (text);
|
||||
if (strpos ($value, '"') !== false)
|
||||
{
|
||||
|
|
@ -471,6 +475,10 @@ class VariableBase
|
|||
if (strlen($item) > 2 && (substr($item, 0, 1) === substr($item, -1)) && substr($item, -1) === '"')
|
||||
{
|
||||
$item = substr($item, 1, -1);
|
||||
if (substr($item, 0, 1) === '-')
|
||||
{
|
||||
$escaped_hyphen = true;
|
||||
}
|
||||
}
|
||||
elseif (strlen($item) > 3 && (substr($item, 0, 1) === '-') && (substr($item, 1, 1) === substr($item, -1)) && substr($item, -1) === '"')
|
||||
{
|
||||
|
|
@ -507,7 +515,7 @@ class VariableBase
|
|||
}
|
||||
else
|
||||
{
|
||||
if (substr($item, 0, 1) === '-')
|
||||
if (substr($item, 0, 1) === '-' && $escaped_hyphen !== true)
|
||||
{
|
||||
$conditions[] = sprintf('%s NOT LIKE ?', $column);
|
||||
$item = substr($item, 1);
|
||||
|
|
@ -516,7 +524,7 @@ class VariableBase
|
|||
{
|
||||
$conditions[] = sprintf('%s LIKE ?', $column);
|
||||
}
|
||||
$params[] = '%' . str_replace(['\\', '_', '%'], ['\\\\', '\_', '\%'], $item) . '%';
|
||||
$params[] = '%' . str_replace(['\\', '_', '%', '-'], ['\\\\', '\_', '\%', '\-'], $item) . '%';
|
||||
// if there is no operator, assume 'AND'
|
||||
$conditions[] = 'AND';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue