开发者

Input sanitization for database interaction in zend framework

开发者 https://www.devze.com 2023-04-01 06:18 出处:网络
In commands like this in zend framework $mapperObject->fetchAll($where, $order, $count, $offset); Does one need to be careful about what the variables contain 开发者_C百科or ZF will take care of

In commands like this in zend framework

$mapperObject->fetchAll($where, $order, $count, $offset);

Does one need to be careful about what the variables contain 开发者_C百科or ZF will take care of it for sql injection and all that?


Assuming this is using the standard Zend_Db_Table->fetchAll, then you are indeed protected from SQL injection as long as you use the secure methods for creating your parameters eg:

 $where = $select->where('id = ?', $id);
 // or ..
 $where = $select->where('id = :id');

and not

 $where = $select->where('id = $id');
0

精彩评论

暂无评论...
验证码 换一张
取 消