php - Doctrine ORM with $_GET Variables and security? -


i use scripts have sort fields.

nothing special wondering. have code:

$data = $this->getdoctrine()->getrepository('mybundle:data')->findby(array("id" => $id), array($_get["sort"] => $_get["direction"])); 

if give field in "sort" non-existent there error. exploited sql injection?

if so, best way avoid that?

since $_get["sort"] used pass in field sort on fill in whatever want sort on... don't think harm can done because doctrine filter out bad things still don't recommend this. try cleaning @ least $_get["sort"] , $_get["direction"] fields.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -