For some reason the AppModel->updateAll() method does not escape data passed to it. Looking over the documentation though, I can’t find anything on how you actually escape data with CakePHP.
Down in datasources/dbo/dbo_mysql.php I found the value() method that seems to just use mysql_real_escape_string() – but how do you access that method from up in the models?
For most of CakePHP’s model functions you don’t have to worry about escaping the input.
Use Prepared Statements
Custom Escaping with
Model->getDataSource()->value()The
value()function basically escapes and adds quotes like this:Sanitize Class
This used to be an option, but was deprecated as of CakePHP 2.4.