Avatar

magic_quotes_gpc (Bugs)

by Alex ⌂ @, Wednesday, January 27, 2010, 07:45 (1728 days ago) @ Milo

Is it possible, that "REQUEST" is not contained in the global array?

Hm... no idea! IMHO the better way is to do it the other way round: strip slashes if magic_quotes_gpc is enabled (which shouldn't be the case anymore).

// stripslashes on GPC if magic_quotes_gpc is enabled: 
if(get_magic_quotes_gpc()) 
 {
  function stripslashes_deep($value)
   {
    $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
    return $value;
   }
  $_POST = array_map('stripslashes_deep', $_POST);
  $_GET = array_map('stripslashes_deep', $_GET);
  $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
  $_REQUEST = array_map('stripslashes_deep', $_REQUEST);
 }

Alex


Complete thread:

 RSS Feed of thread

powered by my little forum