Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?
  2. function safety( $array )
  3. {
  4. $array2 = array();
  5. foreach( $array as $key => $value )
  6. {
  7.  
  8. if( get_magic_quotes_gpc() )
  9. {
  10. $key = stripslashes($key);
  11. }
  12. $key = str_replace(array("\\\\0","\\\0","\\0","\0"),"", $key);
  13. $key = htmlentities($key,ENT_QUOTES);
  14.  
  15. if( is_array($value) )
  16. {
  17. $value = safety( $value );
  18. }
  19. else
  20. {
  21. if( get_magic_quotes_gpc() )
  22. {
  23. $value = stripslashes($value);
  24. }
  25. $value = str_replace(array("\\\\0","\\\0","\\0","\0"),"", $value);
  26. $value = htmlentities($value,ENT_QUOTES);
  27. }
  28. $array2[ $key ] = $value;
  29. }
  30. return $array2;
  31. }
  32. $_POST = safety($_POST);
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement