Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 2eb6f84

Browse files
Merge pull request #3174 from magento-qwerty/MAGETWO-93969
Performed tasks: - MAGETWO-93969 Declaring allowed HTTP methods for controllers
2 parents a9ff217 + 13ea91a commit 2eb6f84

File tree

387 files changed

+2329
-670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+2329
-670
lines changed

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\AdminNotification\Controller\Adminhtml\Notification;
88

9-
class Index extends \Magento\AdminNotification\Controller\Adminhtml\Notification
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class Index extends \Magento\AdminNotification\Controller\Adminhtml\Notification implements HttpGetActionInterface
1012
{
1113
/**
1214
* @return void

app/code/Magento/AdvancedPricingImportExport/Controller/Adminhtml/Export/GetFilter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
*/
66
namespace Magento\AdvancedPricingImportExport\Controller\Adminhtml\Export;
77

8+
use Magento\Framework\App\Action\HttpGetActionInterface;
9+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
810
use Magento\ImportExport\Controller\Adminhtml\Export as ExportController;
911
use Magento\Framework\Controller\ResultFactory;
1012
use Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing as ExportAdvancedPricing;
1113
use Magento\Catalog\Model\Product as CatalogProduct;
1214

13-
class GetFilter extends ExportController
15+
class GetFilter extends ExportController implements HttpGetActionInterface, HttpPostActionInterface
1416
{
1517
/**
1618
* Get grid-filter of entity attributes action.

app/code/Magento/Analytics/Controller/Adminhtml/BIEssentials/SignUp.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
*/
66
namespace Magento\Analytics\Controller\Adminhtml\BIEssentials;
77

8+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
89
use Magento\Backend\App\Action;
910
use Magento\Backend\App\Action\Context;
1011
use Magento\Framework\App\Config\ScopeConfigInterface;
1112

1213
/**
1314
* Provides link to BI Essentials signup
1415
*/
15-
class SignUp extends Action
16+
class SignUp extends Action implements HttpGetActionInterface
1617
{
1718
/**
1819
* Path to config value with URL to BI Essentials sign-up page.

app/code/Magento/Analytics/Controller/Adminhtml/Reports/Show.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Analytics\Controller\Adminhtml\Reports;
77

8+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
89
use Magento\Analytics\Model\Exception\State\SubscriptionUpdateException;
910
use Magento\Analytics\Model\ReportUrlProvider;
1011
use Magento\Backend\App\Action;
@@ -16,7 +17,7 @@
1617
/**
1718
* Provide redirect to resource with reports.
1819
*/
19-
class Show extends Action
20+
class Show extends Action implements HttpGetActionInterface
2021
{
2122
/**
2223
* @var ReportUrlProvider

app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Authorizenet\Controller\Directpost\Payment;
88

9+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
910
use Magento\Authorizenet\Controller\Directpost\Payment;
1011
use Magento\Authorizenet\Helper\DataFactory;
1112
use Magento\Checkout\Model\Type\Onepage;
@@ -25,7 +26,7 @@
2526
*
2627
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2728
*/
28-
class Place extends Payment
29+
class Place extends Payment implements HttpPostActionInterface
2930
{
3031
/**
3132
* @var \Magento\Quote\Api\CartManagementInterface

app/code/Magento/Backend/Block/Widget/Form/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected function _construct()
9393
'class' => 'delete',
9494
'onclick' => 'deleteConfirm(\'' . __(
9595
'Are you sure you want to do this?'
96-
) . '\', \'' . $this->getDeleteUrl() . '\')'
96+
) . '\', \'' . $this->getDeleteUrl() . '\', {data: {}})'
9797
]
9898
);
9999
}

app/code/Magento/Backend/Controller/Adminhtml/Auth/DeniedJson.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Auth;
88

9-
class DeniedJson extends \Magento\Backend\Controller\Adminhtml\Auth
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class DeniedJson extends \Magento\Backend\Controller\Adminhtml\Auth implements HttpGetActionInterface
1012
{
1113
/**
1214
* @var \Magento\Framework\Controller\Result\JsonFactory

app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Auth;
88

9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGet;
10+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPost;
11+
912
/**
1013
* @api
1114
* @since 100.0.2
1215
*/
13-
class Login extends \Magento\Backend\Controller\Adminhtml\Auth
16+
class Login extends \Magento\Backend\Controller\Adminhtml\Auth implements HttpGet, HttpPost
1417
{
1518
/**
1619
* @var \Magento\Framework\View\Result\PageFactory

app/code/Magento/Backend/Controller/Adminhtml/Auth/Logout.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Auth;
88

9-
class Logout extends \Magento\Backend\Controller\Adminhtml\Auth
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGet;
10+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPost;
11+
12+
class Logout extends \Magento\Backend\Controller\Adminhtml\Auth implements HttpGet, HttpPost
1013
{
1114
/**
1215
* Administrator logout action

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
910
use Magento\Framework\Exception\LocalizedException;
1011
use Magento\Framework\Controller\ResultFactory;
1112

12-
class CleanImages extends \Magento\Backend\Controller\Adminhtml\Cache
13+
class CleanImages extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
1314
{
1415
/**
1516
* Authorization level of a basic admin session

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
910
use Magento\Framework\Exception\LocalizedException;
1011
use Magento\Framework\Controller\ResultFactory;
1112

12-
class CleanMedia extends \Magento\Backend\Controller\Adminhtml\Cache
13+
class CleanMedia extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
1314
{
1415
/**
1516
* Authorization level of a basic admin session

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanStaticFiles.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
910
use Magento\Framework\Controller\ResultFactory;
1011

11-
class CleanStaticFiles extends \Magento\Backend\Controller\Adminhtml\Cache
12+
class CleanStaticFiles extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
1213
{
1314
/**
1415
* Authorization level of a basic admin session

app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushAll.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

9-
class FlushAll extends \Magento\Backend\Controller\Adminhtml\Cache
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class FlushAll extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
1012
{
1113
/**
1214
* Authorization level of a basic admin session

app/code/Magento/Backend/Controller/Adminhtml/Cache/FlushSystem.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

9-
class FlushSystem extends \Magento\Backend\Controller\Adminhtml\Cache
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class FlushSystem extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
1012
{
1113
/**
1214
* Authorization level of a basic admin session

app/code/Magento/Backend/Controller/Adminhtml/Cache/Index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

9-
class Index extends \Magento\Backend\Controller\Adminhtml\Cache
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class Index extends \Magento\Backend\Controller\Adminhtml\Cache implements HttpGetActionInterface
1012
{
1113
/**
1214
* Display cache management grid

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/Index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9-
class Index extends \Magento\Backend\Controller\Adminhtml\Dashboard
9+
use Magento\Backend\Controller\Adminhtml\Dashboard as DashboardAction;
10+
use Magento\Framework\App\Action\HttpGetActionInterface;
11+
use Magento\Framework\App\Action\HttpPostActionInterface;
12+
13+
class Index extends DashboardAction implements HttpGetActionInterface, HttpPostActionInterface
1014
{
1115
/**
1216
* @var \Magento\Framework\View\Result\PageFactory

app/code/Magento/Backend/Controller/Adminhtml/Index/GlobalSearch.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Index;
88

9+
use Magento\Backend\Controller\Adminhtml\Index as IndexAction;
10+
use Magento\Framework\App\Action\HttpGetActionInterface;
11+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
12+
913
/**
1014
* @api
1115
* @since 100.0.2
1216
*/
13-
class GlobalSearch extends \Magento\Backend\Controller\Adminhtml\Index
17+
class GlobalSearch extends IndexAction implements HttpGetActionInterface, HttpPostActionInterface
1418
{
1519
/**
1620
* @var \Magento\Framework\Controller\Result\JsonFactory

app/code/Magento/Backend/Controller/Adminhtml/Index/Index.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Index;
88

9-
class Index extends \Magento\Backend\Controller\Adminhtml\Index
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGet;
10+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPost;
11+
12+
class Index extends \Magento\Backend\Controller\Adminhtml\Index implements HttpGet, HttpPost
1013
{
1114
/**
1215
* Admin area entry point

app/code/Magento/Backend/Controller/Adminhtml/Noroute/Index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Noroute;
88

9+
/**
10+
* @SuppressWarnings(PHPMD.AllPurposeAction)
11+
*/
912
class Index extends \Magento\Backend\App\Action
1013
{
1114
/**

app/code/Magento/Backend/Controller/Adminhtml/System/Account/Index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Account;
88

9-
class Index extends \Magento\Backend\Controller\Adminhtml\System\Account
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class Index extends \Magento\Backend\Controller\Adminhtml\System\Account implements HttpGetActionInterface
1012
{
1113
/**
1214
* @var \Magento\Framework\View\Result\PageFactory

app/code/Magento/Backend/Controller/Adminhtml/System/Design/Index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Design;
88

9-
class Index extends \Magento\Backend\Controller\Adminhtml\System\Design
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class Index extends \Magento\Backend\Controller\Adminhtml\System\Design implements HttpGetActionInterface
1012
{
1113
/**
1214
* @return \Magento\Backend\Model\View\Result\Page

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsite.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

9-
class DeleteWebsite extends \Magento\Backend\Controller\Adminhtml\System\Store
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class DeleteWebsite extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpGetActionInterface
1012
{
1113
/**
1214
* @return \Magento\Framework\Controller\ResultInterface

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

9+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
910
use Magento\Framework\Controller\ResultFactory;
1011

11-
class DeleteWebsitePost extends \Magento\Backend\Controller\Adminhtml\System\Store
12+
class DeleteWebsitePost extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpPostActionInterface
1213
{
1314
/**
1415
* @return \Magento\Backend\Model\View\Result\Redirect

app/code/Magento/Backend/Controller/Adminhtml/System/Store/EditStore.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

9-
class EditStore extends \Magento\Backend\Controller\Adminhtml\System\Store
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class EditStore extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpGetActionInterface
1012
{
1113
/**
1214
* @return \Magento\Framework\Controller\ResultInterface

app/code/Magento/Backend/Controller/Adminhtml/System/Store/EditWebsite.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

9-
class EditWebsite extends \Magento\Backend\Controller\Adminhtml\System\Store
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class EditWebsite extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpGetActionInterface
1012
{
1113
/**
1214
* @return \Magento\Backend\Model\View\Result\Forward

app/code/Magento/Backend/Controller/Adminhtml/System/Store/Index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
910
use Magento\Framework\Controller\ResultFactory;
1011

1112
/**
1213
* Class Index returns Stores page
1314
*/
14-
class Index extends \Magento\Backend\Controller\Adminhtml\System\Store
15+
class Index extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpGetActionInterface
1516
{
1617
/**
1718
* Returns Stores page

app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

9+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
10+
911
/**
1012
* Class Save
1113
*
1214
* Save controller for system entities such as: Store, StoreGroup, Website
1315
*/
14-
class Save extends \Magento\Backend\Controller\Adminhtml\System\Store
16+
class Save extends \Magento\Backend\Controller\Adminhtml\System\Store implements HttpPostActionInterface
1517
{
1618
/**
1719
* Process Website model save

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
<preference for="Magento\Framework\App\DefaultPathInterface" type="Magento\Backend\App\DefaultPath" />
1515
<preference for="Magento\Backend\App\ConfigInterface" type="Magento\Backend\App\Config" />
1616
<preference for="Magento\Framework\App\Response\Http\FileFactory" type="Magento\Backend\App\Response\Http\FileFactory" />
17-
<preference for="Magento\Framework\App\Request\ValidatorInterface"
18-
type="Magento\Backend\App\Request\BackendValidator" />
1917
<type name="Magento\Framework\Stdlib\DateTime\Timezone">
2018
<arguments>
2119
<argument name="scopeType" xsi:type="const">Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT</argument>
@@ -169,4 +167,5 @@
169167
<argument name="defaultClass" xsi:type="string">Magento\Backend\Block\Template</argument>
170168
</arguments>
171169
</type>
170+
<preference for="CsrfRequestValidator" type="Magento\Backend\App\Request\BackendValidator" />
172171
</config>

app/code/Magento/Backup/Controller/Adminhtml/Index/Index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
namespace Magento\Backup\Controller\Adminhtml\Index;
88

9-
class Index extends \Magento\Backup\Controller\Adminhtml\Index
9+
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
10+
11+
class Index extends \Magento\Backup\Controller\Adminhtml\Index implements HttpGetActionInterface
1012
{
1113
/**
1214
* Backup list action

app/code/Magento/Captcha/Controller/Refresh/Index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
*/
99
namespace Magento\Captcha\Controller\Refresh;
1010

11+
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
1112
use Magento\Framework\App\Action\Context;
1213

13-
class Index extends \Magento\Framework\App\Action\Action
14+
class Index extends \Magento\Framework\App\Action\Action implements HttpPostActionInterface
1415
{
1516
/**
1617
* @var \Magento\Captcha\Helper\Data

app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/DeleteButton.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public function getButtonData()
2727
return [
2828
'id' => 'delete',
2929
'label' => __('Delete'),
30-
'on_click' => "categoryDelete('" . $this->getDeleteUrl() . "')",
30+
'on_click' => "deleteConfirm('" .__('Are you sure you want to delete this category?') ."', '"
31+
. $this->getDeleteUrl() . "', {data: {}})",
3132
'class' => 'delete',
3233
'sort_order' => 10
3334
];

0 commit comments

Comments
 (0)