I have a problem with sanitization. In AppController I'm using Sanitization utility but It doesn't work. When I want to call my update It fails because of ' slash in my input text. I'm using CakePHP 2.3.6.
function beforeFilter(){
if(!empty($this->data)){
App::uses('Sanitize', 'Utility');
$this->request->data = Sanitize::clean($this->data, array('remove_html'=>true,'encode'=>false,'unicode'=>false,'backslash'=>true, 'escape'=>false));
}
}
Controller code:
$this->ClientProfile->updateAll(
array('ClientProfile.location'=>"'".$this->User->data['ClientProfile']['location']."'"),
array('ClientProfile.user_id'=>$userdata['id'])
);
Any ideas?