disabling magic quotes fails all the times with htaccess

Einfach Dinge, die nichts mit XAMPP, Apache Friends, Apache, MySQL, PHP und alle dem zu tun haben. Allerlei halt. ;)

disabling magic quotes fails all the times with htaccess

Postby unleash » 04. June 2013 17:17

http://php.net/manual/en/security.magicquotes.php[/quote]


in order to switch Magic Quotes to off i tried both ways - both failed.... and gave back this text

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, at the site.... and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

i tried it this way - by naming the file .htaccess


Code: Select all

<?php


php_flag magic_quotes_gpc off



?>


and also that way


Code: Select all
<?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);
}
?>





what can i do now
hmm i can talk to the serveradmin - but is nt it possible to do it at the www-side - the webroot!?

love to hear from you
unleash
 
Posts: 147
Joined: 03. December 2011 10:16
Operating System: OpenSuse Linux 12.1

Re: disabling magic quotes fails all the times with htaccess

Postby WilliL » 04. June 2013 18:35

Hi unleach,

if you use an .htaccess file, don't use php style.

.htaccess is called befor php can be interpreted.
just try in your .htaccess
Code: Select all
php_flag magic_quotes_gpc off

or try in your php script
Code: Select all
<?php
       ini_set('magic_quotes_gpc','off');
?>

but I'm not sure that it works
http://php.net/manual/de/function.ini-set.php
Willi
WilliL
 
Posts: 660
Joined: 08. January 2010 10:54
Operating System: Win7Home Prem 64 SP1


Return to Allerlei

Who is online

Users browsing this forum: No registered users and 8 guests