Skip to content

Commit

Permalink
Sanitize request input before passing it to expression language evalu…
Browse files Browse the repository at this point in the history
…ator
  • Loading branch information
pamil committed Aug 14, 2020
1 parent 1bea002 commit f897346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bundle/Grid/Parser/OptionsParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function parseOptionExpression(string $expression, Request $request)
$expression = (string) preg_replace_callback('/\$(\w+)/', function (array $matches) use ($request) {
$variable = $request->get($matches[1]);

return is_string($variable) ? sprintf('"%s"', $variable) : $variable;
return is_string($variable) ? sprintf('"%s"', addslashes($variable)) : $variable;
}, $expression);

return $this->expression->evaluate($expression, ['container' => $this->container]);
Expand Down

0 comments on commit f897346

Please sign in to comment.