0

I would like to disable a magic quotes on my page. I don't have access to php.ini... When I try add to my .htaccess this line: php_flag magic_quotes_gpc off

I get: 500 Internal Server Error. In my index of errors, I found this:

[Mon Nov 25 23:49:16 2013] [alert] [client MY_IP] /home/USER/public_html/.htaccess: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration, referer: http://my-page.pl/index

I know, I can add this code after '< ?php':

if (get_magic_quotes_gpc()) {
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    while (list($key, $val) = each($process)) {
        foreach ($val as $k => $v) {
            unset($process[$key][$k]);
            if (is_array($v)) {
                $process[$key][stripslashes($k)] = $v;
                $process[] = &$process[$key][stripslashes($k)];
            } else {
                $process[$key][stripslashes($k)] = stripslashes($v);
            }
        }
    }
    unset($process);
}

but I'm not convince to this tip. Have you got any ideas for me?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
user3022527
  • 2,107
  • 2
  • 14
  • 11

0 Answers0