RE: Turning off magic_quotes_gpc?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michael Stroh

> I'm maintaining various php scripts on a server that was originally 
> configured to have magic_quotes_gpc turned on. The installed php
version 
> is 5.2.6. I've read that magic_quotes_gpc is deprecated in 5.3 and 
> continuing to use it is "highly discouraged." I've ran into a few
fields 
> that I believe this is causing issues with so I'm considering turning
it 
> off but am wondering what steps should I take to make sure that
nothing 
> breaks and what should I look out for? Also, is it still a good idea
to 
> turn off since this installation isn't yet at 5.3?

It's a good idea to turn it off as soon as possible. However, you need
to test your site to make sure it won't broke something first.

There is a way to undo the results of magic quotes. We have implemented
it on a number of sites so that we won't care when it gets turned off.
Early in the script we have the following code:

    // If magic quotes is on, we want to remove slashes
    if (get_magic_quotes_gpc()) {
      // Magic quotes is on
      $response = stripslashes($_GET[$key]);
    }

Bob McConnell

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux