Voici une petite commande PHP qui vous permettra de désactiver ou plutôt de nettoyer les magic_quotes quand ces dernières sont activées ( et accessoirement de préparer votre code si la fonction get_magic_quotes_gpc() venait à disparaître dans PHP 6 ).
if(!function_exists('get_magic_quotes_gpc')) {
// En prevision de PHP 6
function get_magic_quotes_gpc() { return 0; }
}
if(get_magic_quotes_gpc()) {
function undo_magic_quotes(&$array) {
foreach($array as $key => $value) {
if(is_array($array[$key])) {
undo_magic_quotes($array[$key]);
} else {
$array[$key] = stripslashes($value);
}
}
}
undo_magic_quotes($_GET);
undo_magic_quotes($_POST);
undo_magic_quotes($_COOKIE);
undo_magic_quotes($_REQUEST);
undo_magic_quotes($_FILES);
}