Answer the question
In order to leave comments, you need to log in
Does expr()->literal() protect against SQL injection?
They make a filter and have doubts about such a decision. Is SQL injection possible? If so, how to solve.
$orStatements = $this->queryBuilder->expr()->orX();
foreach ($result as $value) {
$orStatements->add(
$this->queryBuilder->expr()->like('table.column', $this->queryBuilder->expr()->literal('%' . $value . '%'))
);
}
$this->queryBuilder->andWhere($orStatements);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question