Skip to content

Commit cbdf1d8

Browse files
Mingsong HuMingsong Hu
authored andcommitted
An entity form does not need a CSRF token
1 parent 272082c commit cbdf1d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

DrupalSecurity/Sniffs/Yaml/RoutingAccessSniff.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ public function process(File $phpcsFile, $stackPtr) {
121121
}
122122

123123
// CSRF token test for non-open access route.
124-
if (!isset($rout['defaults']['_form']) && !$open_access) {
124+
if (!isset($rout['defaults']['_form']) &&
125+
!isset($rout['defaults']['_entity_form']) &&
126+
!$open_access) {
125127
// Search for _csrf_token.
126128
if ($csrf_token = $requirements['_csrf_token'] ?? false) {
127129
if (!$csrf_token) {

0 commit comments

Comments
 (0)