I've been looking at increasing security and stability across some of my websites and one thing I've been checking is escaping all input from users (as I should be doing).
In a lot of cases, I'm using the standard Zend_Db_Table_Row setFromArray() method, i.e.
$myForm = new Form_MyForm();
$myTable = new Model_DbTable_MyTable();
if ($this->getRequest()->isPost())
{
if ($myForm->isValid($_POST))
{
$myRow = $myTable->createRow();
$myRow->setFromArray($_POST);
$myRow->save();
}
}
This works fine, as expected. However I'm not aware if the input is escaped at any point of this code (like all input from a user should be before being put anywhere near the database). I use quoteInto() in Zend, but also use mysqli_real_escape_string() externally.
Does anyone know if the user input is escaped in the above example (ready for the DB), and if not, how do I escape it if I want to continue using the setFromArray() method?