_init()
check_token()
clean()
clean_input()
clean_uri()
fetch_token()
generate_token()
htmlentities()
js_fetch_token()
js_set_token()
set_token()
strip_tags()
xss_clean()
$csrf_old_token
$csrf_token
$csrf_token_key
Security Class
package | Fuel |
---|---|
category | Core |
author | Dan Horrigan |
link | http://docs.fuelphp.com/classes/security.html |
_init()
Fetches CSRF settings and current token
\Fuel\Core\SecurityException |
it the CSRF token validation failed |
---|---|
\Fuel\Core\FuelException |
if no security output filter is defined |
check_token(string $value) : bool
string
CSRF token to be checked, checks post when empty
bool
clean(mixed $var, mixed $filters, string $type) : array | mixed
mixed
mixed
string
array
mixed
clean_input()
clean_uri(string $uri, bool $strict) : array | mixed
string
uri to clean
bool
whether to remove relative directories
array
mixed
fetch_token() : string
string
generate_token() : string
Based on an example from OWASP
string
htmlentities($value, $flags, $encoding, $double_encode)
js_fetch_token() : string
Produces JavaScript fuel_csrf_token() function that will return the current CSRF token when called. Use to fill right field on form submit for AJAX operations.
string
js_set_token() : string
Produces JavaScript fuel_set_csrf_token() function that will update the current CSRF token in the form when called, based on the value of the csrf cookie
string
set_token(\Fuel\Core\$rotate $rotate)
\Fuel\Core\$rotate
bool if true, generate a new token, even if the current token is still valid
xss_clean($value, array $options)
$csrf_old_token : string
$csrf_token : string
$csrf_token_key : string