| Next we'll gather the input to the application based on the global input | variables for the current request. The input will be gathered based on | the current request method and will be set on the Input manager class | as a simple static $input property which can be easily accessed. | */ $input = array(); switch (Request::method()) { case 'GET': $input = $_GET; break; case 'POST': $input = $_POST; break; default: if (Request::spoofed()) { $input = $_POST; } else { parse_str(file_get_contents('php://input'), $input); if (magic_quotes()) { $input = array_strip_slashes($input); } } } /* |-------------------------------------------------------------------------- | Remove The Spoofer Input |-------------------------------------------------------------------------- | | The spoofed request method is removed from the input so it is not in | the Input::all() or Input::get() results. Leaving it in the array
/** * Hydrate the input data for the request. * * @return void */ public static function hydrate() { switch (Request::method()) { case 'GET': static::$input =& $_GET; break; case 'POST': static::$input =& $_POST; break; case 'PUT': case 'DELETE': if (Request::spoofed()) { static::$input =& $_POST; } else { parse_str(file_get_contents('php://input'), static::$input); } } }