Skip to content

Commit

Permalink
EZP-31675: do not resolve nor change type of non-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertrand Dunogier committed Jun 8, 2020
1 parent a9ff4fd commit c4c8862
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/API/QueryFieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,24 @@ private function resolveParameters(array $expressions, array $variables): array
foreach ($expressions as $key => $expression) {
if (is_array($expression)) {
$expressions[$key] = $this->resolveParameters($expression, $variables);
} else {
} elseif ($this->isExpression($expression)) {
$expressions[$key] = $this->resolveExpression($expression, $variables);
} else {
$expressions[$key] = $expression;
}
}

return $expressions;
}

private function isExpression($expression): bool
{
return is_string($expression) && substr($expression, 0, 2) === '@=';
}

private function resolveExpression(string $expression, array $variables)
{
if (substr($expression, 0, 2) !== '@=') {
if (!$this->isExpression($expression)) {
return $expression;
}

Expand Down

0 comments on commit c4c8862

Please sign in to comment.