Browse Source

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

Fabien Potencier 14 năm trước cách đây
mục cha
commit
eb8b3d9c21

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

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