Data Sanitization.
Removal of alphanumeric characters, SQL-safe slash-added strings, HTML-friendly strings, and all of the above on arrays.
Sanitizes given array or value for safe input. Use the options to specify the connection to use, and what filters should be applied (with a boolean value). Valid filters:
Strips the specified tags from output. First parameter is string from where to remove tags. All subsequent parameters are tags.
clean( string|array $data , string|array $options array() )
Sanitizes given array or value for safe input. Use the options to specify the connection to use, and what filters should be applied (with a boolean value). Valid filters:
remove_html
to work.$
with \$
\r
encode
must be true for this option to work.$data
$options
optional array() escape( string $string , string $connection 'default' )
Makes a string SQL-safe.
$string
$connection
optional 'default' html( string $string , array $options array() )
Returns given string safe for display as HTML. Renders entities.
strip_tags() does not validating HTML syntax or structure, so it might strip whole passages with broken HTML.
$string
$options
optional array() paranoid( string $string , array $allowed array() )
Removes any non-alphanumeric characters.
$string
$allowed
optional array() stripAll( string $str )
Strips extra whitespace, images, scripts and stylesheets from output
$str
stripImages( string $str )
Strips image tags from output
$str
stripScripts( string $str )
Strips scripts and stylesheets from output
$str
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/2.9/class-Sanitize.html