• [^] # Re: *khof* *khof*

    Posté par . En réponse à la dépêche Zend Framework 1.0.0 : PHP à la suite de Ruby on Rail. Évalué à 2.

    Magic_quotes ça saute aussi dans php6. En attendant:


    class Tools
    {
    static public function remove_magic_quotes(&$array)
    {
    foreach($array as $key => $val)
    {
    if(is_array($val))
    {
    self::remove_magic_quotes($array[$key]);
    }
    else if(is_string($val))
    {
    $array[$key] = stripslashes($val);
    }
    }
    }
    }


    if(get_magic_quotes_gpc() == 1)
    {
    if(!empty($_POST))
    {
    Tools::remove_magic_quotes($_POST);
    }
    if(!empty($_GET))
    {
    Tools::remove_magic_quotes($_GET);
    }
    }


    et il n'y a plus de problème.