Magic Quotes Fix


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (ini_get('magic_quotes_gpc')) {
  2. function clean($data) {
  3. if (is_array($data)) {
  4. foreach ($data as $key => $value) {
  5. $data[clean($key)] = clean($value);
  6. }
  7. } else {
  8. $data = stripslashes($data);
  9. }
  10.  
  11. return $data;
  12. }
  13.  
  14. $_GET = clean($_GET);
  15. $_POST = clean($_POST);
  16. $_COOKIE = clean($_COOKIE);
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.