Magic quotes gpc, automatically adds " 's to strings, thats why with some sites... any "'s, have \'s or something... its bugging
Just remember, if you do disable it... any strings you send to a database MUST have slashes
So: 'SELECT * FROM '.$table.' WHERE x=4'
Should become: 'SELECT * FROM '.addslashes($table).' WHERE x = 4'
Anyway, the removal script
(Only runs when it is activated)
CODE
/*----------------------------------------------
MAGIC QUOTES DISABLER
hopefully this file is included before
anything else
----------------------------------------------*/
// ah... before we do anything, kill teh magic_quotes -- YAY
function StripSlashArray_Deep(&$array)
{
foreach ($array as $key=>$value)
{
if (is_array($value))
{
StripSlashArray_Deep($array[$key]);
}else if (is_string($value))
{
$array[$key] = stripslashes($value);
}
}
}
if (get_magic_quotes_gpc()) // The php manual warns us... this wont work with magic_quotes_sybase
{
// Trust that its off =/
StripSlashArray_Deep($_GET);
StripSlashArray_Deep($_POST);
StripSlashArray_Deep($_COOKIE);
}
set_magic_quotes_runtime(0);
/*----------------------------------------------
MAGIC QUOTES DISABLED
yay, they all gone, now you can use
addslashes in safety...
----------------------------------------------*/