$bags =
[ 'query' => 'Potentially unsafe keys removed from query string parameters (GET): %s',
'request' => 'Potentially unsafe keys removed from request body parameters (POST): %s',
'cookies' => 'Potentially unsafe keys removed from cookie parameters: %s',
];
foreach ($bags as $bag =>
$message) { if (static::
processParameterBag($request->
$bag,
$safe_keys,
$log_sanitized_keys,
$bag,
$message)) { $update_globals = TRUE;
} } if ($update_globals) { $request->
overrideGlobals();
} $request->attributes->
set(self::SANITIZED, TRUE
);
} return $request;
} /**
* Processes a request parameter bag.
*
* @param \Symfony\Component\HttpFoundation\ParameterBag $bag
* The parameter bag to process.
* @param string[] $safe_keys
* An array of keys to consider safe.
* @param bool $log_sanitized_keys
* Set to TRUE to log keys that are sanitized.
* @param string $bag_name
* The request parameter bag name. Either 'query', 'request' or 'cookies'.
* @param string $message
* The message to log if the parameter bag contains keys that are removed.
* If the message contains %s that is replaced by a list of removed keys.
*
* @return bool
* TRUE if the parameter bag has been sanitized, FALSE if not.
*/