Posted By

sb_01 on 09/25/10


Tagged


Versions (?)

Magic Quotes Fix


 / Published in: PHP
 

  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  

You need to login to post a comment.