File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed
lib/internal/Magento/Framework/App/Action Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Forward action class
4
- *
5
3
* Copyright © Magento, Inc. All rights reserved.
6
4
* See COPYING.txt for license details.
7
5
*/
8
6
namespace Magento \Framework \App \Action ;
9
7
8
+ use Magento \Framework \App \CsrfAwareActionInterface ;
10
9
use Magento \Framework \App \RequestInterface ;
10
+ use Magento \Framework \App \Request \InvalidRequestException ;
11
11
use Magento \Framework \App \ResponseInterface ;
12
12
13
13
/**
14
14
* Forward request further.
15
15
*
16
16
* @SuppressWarnings(PHPMD.AllPurposeAction)
17
17
*/
18
- class Forward extends AbstractAction
18
+ class Forward extends AbstractAction implements CsrfAwareActionInterface
19
19
{
20
20
/**
21
- * @param RequestInterface $request
22
- * @return ResponseInterface
21
+ * @inheritDoc
23
22
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
24
23
*/
25
24
public function dispatch (RequestInterface $ request )
@@ -35,4 +34,21 @@ public function execute()
35
34
$ this ->_request ->setDispatched (false );
36
35
return $ this ->_response ;
37
36
}
37
+
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ public function createCsrfValidationException (RequestInterface $ request ): ?InvalidRequestException
42
+ {
43
+ return new InvalidRequestException ($ this ->_response );
44
+ }
45
+
46
+ /**
47
+ * @inheritDoc
48
+ */
49
+ public function validateForCsrf (RequestInterface $ request ): ?bool
50
+ {
51
+ // This exists so that we can forward to the noroute action in the admin
52
+ return true ;
53
+ }
38
54
}
You can’t perform that action at this time.
0 commit comments