File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -806,11 +806,9 @@ variable.
806806Validating 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 `
814812method 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\C omponent\S ecurity\C srf\C srfToken;
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
828827Final Thoughts
829828--------------
You can’t perform that action at this time.
0 commit comments