Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sanitize($input) {
- $search = array (
- '@<script[^>]*?>.*?</script>@si',
- '@<[/!]*?[^<>]*?>@si',
- '@<style[^>]*?>.*?</style>@siU',
- '@<![sS]*?--[ tnr]*>@'
- );
- if (is_array ( $input )) {
- foreach ( $input as $var => $val ) {
- $output [$var] = sanitize ( $val );
- }
- } else {
- $input = preg_replace ( $search, "", htmlspecialchars ( stripslashes
- ( trim ( $input ) ) ) );
- }
- return $input;
- }
Add Comment
Please, Sign In to add comment