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
Post a Comment