Jelajahi Sumber

[FrameworkBundle] added support for both csrf-protection and csrf_protection

Fabien Potencier 14 tahun lalu
induk
melakukan
eb8b3d9c21

+ 4 - 0
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

@@ -54,6 +54,10 @@ class FrameworkExtension extends Extension
             $loader->load('form.xml');
             $loader->load('form.xml');
         }
         }
 
 
+        if (isset($config['csrf-protection'])) {
+            $config['csrf_protection'] = $config['csrf-protection'];
+        }
+
         if (isset($config['csrf_protection'])) {
         if (isset($config['csrf_protection'])) {
             foreach (array('enabled', 'field_name', 'field-name', 'secret') as $key) {
             foreach (array('enabled', 'field_name', 'field-name', 'secret') as $key) {
                 if (isset($config['csrf_protection'][$key])) {
                 if (isset($config['csrf_protection'][$key])) {