currently, I'm working on cakephp upgrade from 2.10 to 3.8, I noticed that the classe Sanitize has been removed. Does anyone know how to replace it ?
I have this following function :
public function view( $page )
{
$page = Sanitize::paranoid( $page, array('-', '_') );
$this->render( $page );
}
Really depends on your threat model, ie on what exactly you're trying to protect against.
Sanitize:paranoid()removes non-alphanumeric characters, except the ones in the$allowedargument, so if you wanted to replace the behavior 1:1, you could for example use a regular expression: