Skip to content

Commit 469a216

Browse files
Merge remote-tracking branch '35762/noroute-admin-allowed' into comm_voted_v3
2 parents 45fc993 + d3afc49 commit 469a216

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

lib/internal/Magento/Framework/App/Action/Forward.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
<?php
22
/**
3-
* Forward action class
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86
namespace Magento\Framework\App\Action;
97

8+
use Magento\Framework\App\CsrfAwareActionInterface;
109
use Magento\Framework\App\RequestInterface;
10+
use Magento\Framework\App\Request\InvalidRequestException;
1111
use Magento\Framework\App\ResponseInterface;
1212

1313
/**
1414
* Forward request further.
1515
*
1616
* @SuppressWarnings(PHPMD.AllPurposeAction)
1717
*/
18-
class Forward extends AbstractAction
18+
class Forward extends AbstractAction implements CsrfAwareActionInterface
1919
{
2020
/**
21-
* @param RequestInterface $request
22-
* @return ResponseInterface
21+
* @inheritDoc
2322
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2423
*/
2524
public function dispatch(RequestInterface $request)
@@ -35,4 +34,21 @@ public function execute()
3534
$this->_request->setDispatched(false);
3635
return $this->_response;
3736
}
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+
}
3854
}

0 commit comments

Comments
 (0)