8000 [#5572] Fix syntax · symfony/symfony-docs@f67c353 · GitHub
[go: up one dir, main page]

Skip to content

Commit f67c353

Browse files
committed
[#5572] Fix syntax
1 parent 85dc294 commit f67c353

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

book/controller.rst

Lines changed: 6 additions & 7 deletions
Original file line number< F286 /th>Diff line numberDiff line change
@@ -806,11 +806,9 @@ variable.
806806
Validating a CSRF Token
807807
-----------------------
808808

809-
Sometimes you want to use CSRF protection in an action where you don't want to use the
810-
Symfony Form component.
811-
812-
If, for example, you're doing a DELETE action, you can use the
813-
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::isCsrfTokenValid`
809+
Sometimes, you want to use CSRF protection in an action where you don't want to
810+
use the Symfony Form component. If, for example, you're doing a DELETE action,
811+
you can use the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::isCsrfTokenValid`
814812
method to check the CSRF token::
815813

816814
if ($this->isCsrfTokenValid('token_id', $submittedToken)) {
@@ -821,9 +819,10 @@ method to check the CSRF token::
821819
The ``isCsrfTokenValid()`` shortcut method was introduced in Symfony 2.6.
822820
It is equivalent to executing the following code::
823821

824-
use Symfony\Component\Security\Csrf\CsrfToken;
822+
use Symfony\Component\Security\Csrf\CsrfToken;
825823

826-
$this->get('security.csrf.token_manager')->isTokenValid(new CsrfToken('token_id', 'TOKEN'));
824+
$this->get('security.csrf.token_manager')
825+
->isTokenValid(new CsrfToken('token_id', 'TOKEN'));
827826

828827
Final Thoughts
829828
--------------

0 commit comments

Comments
 (0)
0