K
K
kapai692014-11-04 19:50:15
PHP
kapai69, 2014-11-04 19:50:15

Doctrine2 is this parameter passing safe?

Is such a construct safe in Doctrine2? $param1, $param2 are GET parameters, no filtering at all!

$em->getRepository('AcmeBundle:Default')->findOneByLink(array($param1, $param2));

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
neolink, 2014-11-04
@neolink

if you did not implement the findOneByLink method in the repository, then yes it is safe (that is, either your Link is an array, or you just need to findOneBy)

M
mind3, 2014-11-05
@mind3

It is better to fasten validation and filtering.

N
Narek, 2014-11-05
@webtop

There are no extra checks!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question