Instead of that, using this:

if(!get_magic_quotes_gpc()){
  function deepslash($v){
   return (is_array($v)) ? array_map("deepslash", $v) : addslashes($v);
  }
  $_POST=array_map("deepslash", $_POST);
  $_GET=array_map("deepslash", $_GET);
  $_COOKIE=array_map("deepslash", $_COOKIE);
  $_REQUEST=array_map("deepslash", $_REQUEST);
  $_GLOBALS=array_map("deepslash", $_GLOBALS);
  $_SERVER=array_map("deepslash", $_SERVER);

}

taken from here: http://us2.php.net/manual/en/function.get-magic-quotes-gpc.php Should work much better and you only need to put it at the top of one of the main include files instead of modifying the entire codebase.

-Charles


[EMAIL PROTECTED] wrote:
Hi,

What do you think about that :

function getPOST($name) {
global $_POST;
if(is_set($_POST[$name])) {
 if(get_magic_quotes_gpc () == 1) return *stripslashes(*$_POST[$name]);
 else return $_POST[$name];
}
return null;
}

same thing for $_GET we only need to change all $_GET and $_POST.

I think it's more easy than playing with .htaccess or php.ini.


If you agree, I'll do it tonight.

David





Reply via email to