Guest User

Untitled

a guest
Dec 12th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function sanitize($input) {
  2. $search = array (
  3. '@<script[^>]*?>.*?</script>@si',
  4. '@<[/!]*?[^<>]*?>@si',
  5. '@<style[^>]*?>.*?</style>@siU',
  6. '@<![sS]*?--[ tnr]*>@'
  7. );
  8. if (is_array ( $input )) {
  9. foreach ( $input as $var => $val ) {
  10. $output [$var] = sanitize ( $val );
  11. }
  12. } else {
  13. $input = preg_replace ( $search, "", htmlspecialchars ( stripslashes
  14. ( trim ( $input ) ) ) );
  15. }
  16. return $input;
  17. }
Add Comment
Please, Sign In to add comment