I am new to cakephp and security. I have read that security is built in for protection from MySQL injection if you follow cake’s conventions, but can someone tell me if my save() will be safe without manually calling the Security class?
function edit($id) {
$this->set('title', 'Edit your property');
$this->Unit->id = $id;
if (empty($this->data)) {
$this->data = $this->Unit->read();
} else {
if ($this->Unit->saveAll($this->data)) {
$this->Session->setFlash('Your property has been updated.');
}
}
}
CakePHP will quote the data for you. Unless you are using a method similar to:
which takes SQL literals, you are safe and must not quote the data yourself to avoid getting the quotes in the data. Source: http://book.cakephp.org/2.0/en/models/saving-your-data.html