Welcome Guest, Not a member yet? Register   Sign In
stupid input problem
#11

[eluser]xwero[/eluser]
The changed post method

Code:
function post($index = NULL, $xss_clean = FALSE)
    {        
        if(is_null($index))
                {
                    if(count($_POST) == 0)
                    {
                        return FALSE;
                    }
                    else
                    {
                        if($xss_clean === TRUE)
                        {
                             foreach($_POST as $key => $val)
                             {
                                 $_POST[$key] = $this->xss_clean($val);
                             }
                        }
                        else
                        {
                            return $_POST;
                        }
                   }
                }
        
        if ( ! isset($_POST[$index]))
        {
            return FALSE;
        }

        if ($xss_clean === TRUE)
        {
            if (is_array($_POST[$index]))
            {
                foreach($_POST[$index] as $key => $val)
                {                    
                    $_POST[$index][$key] = $this->xss_clean($val);
                }
            }
            else
            {
                return $this->xss_clean($_POST[$index]);
            }
        }

        return $_POST[$index];
    }


Messages In This Thread
stupid input problem - by El Forum - 03-04-2008, 07:41 AM
stupid input problem - by El Forum - 03-04-2008, 07:45 AM
stupid input problem - by El Forum - 03-04-2008, 07:52 AM
stupid input problem - by El Forum - 03-04-2008, 09:39 AM
stupid input problem - by El Forum - 03-04-2008, 10:17 AM
stupid input problem - by El Forum - 03-04-2008, 10:44 AM
stupid input problem - by El Forum - 03-04-2008, 11:18 AM
stupid input problem - by El Forum - 03-04-2008, 11:21 AM
stupid input problem - by El Forum - 03-04-2008, 12:25 PM
stupid input problem - by El Forum - 03-04-2008, 12:58 PM
stupid input problem - by El Forum - 03-04-2008, 01:05 PM
stupid input problem - by El Forum - 03-11-2008, 03:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB