RequestSanitizer
class RequestSanitizer (View source)
Sanitizes user input.
Constants
| SANITIZED |
Request attribute to mark the request as sanitized. |
| SANITIZE_INPUT_SAFE_KEYS |
The name of the setting that configures the sanitize input safe keys. |
| deprecated SANITIZE_WHITELIST |
Previous name of SANITIZE_INPUT_SAFE_KEYS. |
| SANITIZE_LOG |
The name of the setting that determines if sanitized keys are logged. |
Methods
static Request
sanitize(Request $request, array $safe_keys, bool $log_sanitized_keys = FALSE)
Strips dangerous keys from user input.
static bool
processParameterBag(ParameterBag $bag, array $safe_keys, bool $log_sanitized_keys, string $bag_name, string $message)
Processes a request parameter bag.
static array
checkDestination(string $destination, array $safe_keys)
Checks a destination string to see if it is dangerous.
static mixed
stripDangerousValues(mixed $input, array $safe_keys, array $sanitized_keys)
Strips dangerous keys from $input.
Details
static Request
sanitize(Request $request, array $safe_keys, bool $log_sanitized_keys = FALSE)
Strips dangerous keys from user input.
static protected bool
processParameterBag(ParameterBag $bag, array $safe_keys, bool $log_sanitized_keys, string $bag_name, string $message)
Processes a request parameter bag.
static protected array
checkDestination(string $destination, array $safe_keys)
Checks a destination string to see if it is dangerous.
static protected mixed
stripDangerousValues(mixed $input, array $safe_keys, array $sanitized_keys)
Strips dangerous keys from $input.