public function checkAntiCSRFToken($token = '')
{
if (empty($token)) {
$token = $this->app['request']->get('bolt_csrf_token');
}
$token = new CsrfToken('bolt', $token);
if ($this->app['csrf']->isTokenValid($token)) {
return true;
} else {
$this->app['logger.flash']->warning('The security token was incorrect. Please try again.');
return false;
}
}