mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
feature: csrf protection
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
use MyAAC\CsrfToken;
|
||||
use Twig\Environment as Twig_Environment;
|
||||
use Twig\Extension\DebugExtension as Twig_DebugExtension;
|
||||
use Twig\Loader\FilesystemLoader as Twig_FilesystemLoader;
|
||||
@@ -118,6 +119,16 @@ $function = new TwigFunction('getCustomPage', function ($name) {
|
||||
});
|
||||
$twig->addFunction($function);
|
||||
|
||||
$function = new TwigFunction('csrf', function () {
|
||||
csrf();
|
||||
});
|
||||
$twig->addFunction($function);
|
||||
|
||||
$function = new TwigFunction('csrfToken', function () {
|
||||
return csrfToken();
|
||||
});
|
||||
$twig->addFunction($function);
|
||||
|
||||
$filter = new TwigFilter('urlencode', function ($s) {
|
||||
return urlencode($s);
|
||||
});
|
||||
|
Reference in New Issue
Block a user