forked from fa/breadcrumb-the-shire
refactor(actions): centralize POST/CSRF guard flow
This commit is contained in:
@@ -44,7 +44,7 @@ class PostEndpointCsrfContractTest extends TestCase
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!str_contains($content, 'checkCsrfToken')) {
|
||||
if (!str_contains($content, 'checkCsrfToken') && !str_contains($content, 'actionRequireCsrf(')) {
|
||||
$missing[] = $relativePath;
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,8 @@ class PostEndpointCsrfContractTest extends TestCase
|
||||
private function handlesPostData(string $content): bool
|
||||
{
|
||||
return str_contains($content, "isMethod('POST')")
|
||||
|| str_contains($content, "requestInput()->method()")
|
||||
|| str_contains($content, "(requestInput()->method())")
|
||||
|| str_contains($content, 'hasBody(')
|
||||
|| str_contains($content, 'bodyAll()')
|
||||
|| preg_match('/->body\(/', $content) === 1;
|
||||
|
||||
Reference in New Issue
Block a user