Skip to content

Commit 46bceaf

Browse files
committed
minor #19943 [Security] Update csrf.rst (seb-jean)
This PR was merged into the 7.1 branch. Discussion ---------- [Security] Update csrf.rst Commits ------- fd62622 Update csrf.rst
2 parents c51f88c + fd62622 commit 46bceaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/csrf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ object evaluated to the id::
233233
use Symfony\Component\Security\Http\Attribute\IsCsrfTokenValid;
234234
// ...
235235

236-
#[IsCsrfTokenValid(new Expression('"delete-item-" ~ args["post"].id'), tokenKey: 'token')]
236+
#[IsCsrfTokenValid(new Expression('"delete-item-" ~ args["post"].getId()'), tokenKey: 'token')]
237237
public function delete(Post $post): Response
238238
{
239239
// ... do something, like deleting an object

0 commit comments

Comments
 (0)