orm: custom where value in complex expresssion, fix string expression unescaping
This commit is contained in:
@@ -1275,8 +1275,14 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
$argument = $attribute;
|
||||
|
||||
if (Util::isArgumentString($argument)) {
|
||||
$isSingleQuote = $argument[0] === "'";
|
||||
|
||||
$string = substr($argument, 1, -1);
|
||||
|
||||
$string = $isSingleQuote ?
|
||||
str_replace("\\'", "'", $string) :
|
||||
str_replace('\\"', '"', $string);
|
||||
|
||||
return $this->quote($string);
|
||||
}
|
||||
|
||||
@@ -2884,6 +2890,10 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
$right = $this->applyValueToCustomWhereClause($right, $value);
|
||||
}
|
||||
|
||||
if (is_string($left) && str_ends_with($left, ':') && str_contains($left, '{value}')) {
|
||||
$left = str_replace('{value}', Expression\Util::stringifyArgument($value), $left);
|
||||
}
|
||||
|
||||
$modified[$left] = $right;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user