فهرست منبع

fix csrf token position

Thomas Rabaix 11 سال پیش
والد
کامیت
6edb575435
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      Controller/CRUDController.php

+ 3 - 3
Controller/CRUDController.php

@@ -387,6 +387,9 @@ class CRUDController extends Controller
             throw new \RuntimeException('invalid request type, POST expected');
         }
 
+        // check the csrf token
+        $this->validateCsrfToken('sonata.batch');
+
         $confirmation = $this->get('request')->get('confirmation', false);
 
         if ($data = json_decode($this->get('request')->get('data'), true)) {
@@ -411,9 +414,6 @@ class CRUDController extends Controller
             throw new \RuntimeException(sprintf('The `%s` batch action is not defined', $action));
         }
 
-        // check the csrf token
-        $this->validateCsrfToken('sonata.batch');
-
         $camelizedAction = BaseFieldDescription::camelize($action);
         $isRelevantAction = sprintf('batchAction%sIsRelevant', ucfirst($camelizedAction));