Skip to content

Commit ce9ca87

Browse files
committed
fix csrf_protection configuration for symfony 3
1 parent 0b1dd1e commit ce9ca87

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

resources/config/default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
$loader->import('dist/parameters.yml');
18-
$loader->import('dist/framework.yml');
18+
$loader->import('dist/framework.php');
1919
if (class_exists('Symfony\Bundle\MonologBundle\MonologBundle')) {
2020
$loader->import('dist/monolog.yml');
2121
}

resources/config/dist/framework.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
$config = array(
4+
'secret' => 'test',
5+
'test' => null,
6+
'session' => array(
7+
'storage_id' => 'session.storage.filesystem',
8+
),
9+
'form' => true,
10+
'validation' => array(
11+
'enabled' => true,
12+
'enable_annotations' => true,
13+
),
14+
'router' => array(
15+
'resource' => '%kernel.root_dir%/config/routing.php',
16+
),
17+
'default_locale' => 'en',
18+
'templating' => array(
19+
'engines' => array('twig'),
20+
),
21+
'translator' => array(
22+
'fallback' => 'en',
23+
),
24+
);
25+
26+
if (Symfony\Component\HttpKernel\Kernel::VERSION_ID >= 20800) {
27+
$config['form'] = array(
28+
'csrf_protection' => true
29+
);
30+
} else {
31+
$config['csrf_protection'] = true;
32+
}
33+
34+
$container->loadFromExtension('framework', $config);
35+
36+
$container->loadFromExtension('twig', array(
37+
'debug' => '%kernel.debug%',
38+
'strict_variables' => '%kernel.debug%',
39+
));

resources/config/dist/framework.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)