开发者

Input sanitization for database interaction in zend framework

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜