1
0

refactor(actions): centralize POST/CSRF guard flow

This commit is contained in:
2026-04-24 17:59:57 +02:00
parent 87652e55da
commit cfd867bcd7
16 changed files with 175 additions and 75 deletions

View File

@@ -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;