From ab2c8ef50683f23cd715551a9a5afae19e6d3a1c Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Thu, 17 May 2018 15:08:15 +0300 Subject: [PATCH 01/12] MAGETWO-88603: Invalid Video Uploader Link --- .../view/adminhtml/web/js/new-video-dialog.js | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js index 1ab10c95a51bc..f575f28a5c737 100644 --- a/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js +++ b/app/code/Magento/ProductVideo/view/adminhtml/web/js/new-video-dialog.js @@ -86,6 +86,9 @@ define([ * @private */ _doUpdate: function () { + var uploaderLinkUrl, + uploaderLink; + this.reset(); this.element.find(this.options.container).append('
' + - this.options.metaData.data.uploader + - '' - ); + uploaderLinkUrl = 'https://youtube.com/channel/' + this.options.metaData.data.uploaderUrl; } else if (this.options.videoProvider === 'vimeo') { - this.element.find(this.options.metaData.DOM.uploader).html( - '' + this.options.metaData.data.uploader + - ''); + uploaderLinkUrl = this.options.metaData.data.uploaderUrl; } + uploaderLink = document.createElement('a'); + uploaderLink.setAttribute('href', uploaderLinkUrl); + uploaderLink.setAttribute('target', '_blank'); + uploaderLink.innerText = this.options.metaData.data.uploader; + this.element.find(this.options.metaData.DOM.uploader)[0].appendChild(uploaderLink); this.element.find('.' + this.options.videoClass).productVideoLoader(); }, From f3e15f2e558ae64439e6ebf5cdadee69c9bbed16 Mon Sep 17 00:00:00 2001 From: Dmytro Voskoboinikov Date: Mon, 11 Jun 2018 18:15:27 +0300 Subject: [PATCH 02/12] MAGETWO-72021: Wysiwyg editor incorrectly processes attributes of HTML5 tags --- .../adminhtml/wysiwyg/tiny_mce/html5-schema.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js index 48960ed3403c0..98ce6a005db04 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js @@ -186,11 +186,19 @@ define([ }); _.each(compiled, function (node, nodeName) { - var attributes = node.attributes.join('|'), - children = node.children.join('|'); + var filteredAttributes = []; - validElements.push(nodeName + '[' + attributes + ']'); - validChildren.push(nodeName + '[' + children + ']'); + _.each(node.attributes, function (attribute) { //eslint-disable-line max-nested-callbacks + // Disallowing usage of 'on*' attributes. + if (!/^on/.test(attribute)) { + filteredAttributes.push(attribute); + } + }); + + node.attributes = filteredAttributes; + + validElements.push(nodeName + '[' + node.attributes.join('|') + ']'); + validChildren.push(nodeName + '[' + node.children.join('|') + ']'); }); return { From 79ef4a45c2d18eeae631205a1f1b4bd17d195e99 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Wed, 15 Aug 2018 15:42:00 +0300 Subject: [PATCH 03/12] MAGETWO-88597: Varnish Config Access List --- .../System/Config/Backend/AccessList.php | 37 ++++++++ .../System/Config/Backend/AccessListTest.php | 90 +++++++++++++++++++ .../PageCache/etc/adminhtml/system.xml | 2 +- 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php create mode 100644 app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php diff --git a/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php b/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php new file mode 100644 index 0000000000000..e16584b0b17f8 --- /dev/null +++ b/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php @@ -0,0 +1,37 @@ +getValue(); + if (!is_string($value) || !preg_match('/^[\w\s\.\-\,\:]+$/', $value)) { + throw new LocalizedException( + new Phrase( + 'Access List value "%1" is not valid. ' + .'Please use only IP addresses and host names.', + [$value] + ) + ); + } + } +} diff --git a/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php new file mode 100644 index 0000000000000..1c4f279917c68 --- /dev/null +++ b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php @@ -0,0 +1,90 @@ +getMockForAbstractClass( + ScopeConfigInterface::class + ); + $configMock->expects($this->any()) + ->method('getValue') + ->with('system/full_page_cache/default') + ->willReturn(['access_list' => 'localhost']); + $this->accessList = $objectManager->getObject( + AccessList::class, + [ + 'config' => $configMock, + 'data' => ['field' => 'access_list'] + ] + ); + } + + /** + * @return array + */ + public function getValidValues(): array + { + return [ + ['localhost', 'localhost'], + [null, 'localhost'], + ['127.0.0.1', '127.0.0.1'], + ['127.0.0.1, localhost, ::2', '127.0.0.1, localhost, ::2'], + ]; + } + + /** + * @param mixed $value + * @param mixed $expectedValue + * @dataProvider getValidValues + */ + public function testBeforeSave($value, $expectedValue) + { + $this->accessList->setValue($value); + $this->accessList->beforeSave(); + $this->assertEquals($expectedValue, $this->accessList->getValue()); + } + + /** + * @return array + */ + public function getInvalidValues(): array + { + return [ + ['\\bull val\\'], + ['{*I am not an IP*}'], + ['{*I am not an IP*}, 127.0.0.1'], + ]; + } + + /** + * @param mixed $value + * @expectedException \Magento\Framework\Exception\LocalizedException + * @dataProvider getInvalidValues + */ + public function testBeforeSaveInvalid($value) + { + $this->accessList->setValue($value); + $this->accessList->beforeSave(); + } +} diff --git a/app/code/Magento/PageCache/etc/adminhtml/system.xml b/app/code/Magento/PageCache/etc/adminhtml/system.xml index 1d6c0d890737b..7282a2608496f 100644 --- a/app/code/Magento/PageCache/etc/adminhtml/system.xml +++ b/app/code/Magento/PageCache/etc/adminhtml/system.xml @@ -20,7 +20,7 @@ IPs access list separated with ',' that can purge Varnish configuration for config file generation. If field is empty default value localhost will be saved. - Magento\PageCache\Model\System\Config\Backend\Varnish + Magento\PageCache\Model\System\Config\Backend\AccessList 1 From 3d7e76d6e4a1cb17e3a718221853a71a7473965f Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Wed, 15 Aug 2018 17:45:58 +0300 Subject: [PATCH 04/12] MAGETWO-88597: Varnish Config Access List --- .../Test/Unit/Model/System/Config/Backend/AccessListTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php index 1c4f279917c68..e84b412beb8a5 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/System/Config/Backend/AccessListTest.php @@ -4,6 +4,8 @@ * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\PageCache\Test\Unit\Model\System\Config\Backend; use Magento\PageCache\Model\System\Config\Backend\AccessList; From 3e63d7ba5298d18e3401d919ca07254a97f35975 Mon Sep 17 00:00:00 2001 From: Roman Leshchenko Date: Tue, 28 Aug 2018 16:58:05 +0300 Subject: [PATCH 05/12] MAGETWO-72048: Wrong file upload behavior --- .../Adminhtml/Category/Image/Upload.php | 8 -------- .../Cms/Model/Wysiwyg/Images/Storage.php | 8 -------- .../Unit/Model/Wysiwyg/Images/StorageTest.php | 20 +------------------ .../Adminhtml/Downloadable/File/Upload.php | 9 +-------- .../Downloadable/File/UploadTest.php | 16 --------------- .../Magento/Theme/Model/Wysiwyg/Storage.php | 8 -------- .../Test/Unit/Model/Wysiwyg/StorageTest.php | 3 +-- 7 files changed, 3 insertions(+), 69 deletions(-) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php index 4cc0f2d89d179..e24b142411b83 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php @@ -54,14 +54,6 @@ public function execute() try { $result = $this->imageUploader->saveFileToTmpDir($imageId); - - $result['cookie'] = [ - 'name' => $this->_getSession()->getName(), - 'value' => $this->_getSession()->getSessionId(), - 'lifetime' => $this->_getSession()->getCookieLifetime(), - 'path' => $this->_getSession()->getCookiePath(), - 'domain' => $this->_getSession()->getCookieDomain(), - ]; } catch (\Exception $e) { $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()]; } diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index dfd55f5346e59..b2ef78bab9909 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -501,14 +501,6 @@ public function uploadFile($targetPath, $type = null) // create thumbnail $this->resizeFile($targetPath . '/' . $uploader->getUploadedFileName(), true); - $result['cookie'] = [ - 'name' => $this->getSession()->getName(), - 'value' => $this->getSession()->getSessionId(), - 'lifetime' => $this->getSession()->getCookieLifetime(), - 'path' => $this->getSession()->getCookiePath(), - 'domain' => $this->getSession()->getCookieDomain(), - ]; - return $result; } diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index 2dc98bcefb961..309f08a54aab6 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -440,14 +440,7 @@ public function testUploadFile() $thumbnailDestination = $thumbnailTargetPath . '/' . $fileName; $type = 'image'; $result = [ - 'result', - 'cookie' => [ - 'name' => 'session_name', - 'value' => '1', - 'lifetime' => '50', - 'path' => 'cookie/path', - 'domain' => 'cookie_domain', - ], + 'result' ]; $uploader = $this->getMockBuilder(\Magento\MediaStorage\Model\File\Uploader::class) ->disableOriginalConstructor() @@ -507,17 +500,6 @@ public function testUploadFile() $this->adapterFactoryMock->expects($this->atLeastOnce())->method('create')->willReturn($image); - $this->sessionMock->expects($this->atLeastOnce())->method('getName') - ->willReturn($result['cookie']['name']); - $this->sessionMock->expects($this->atLeastOnce())->method('getSessionId') - ->willReturn($result['cookie']['value']); - $this->sessionMock->expects($this->atLeastOnce())->method('getCookieLifetime') - ->willReturn($result['cookie']['lifetime']); - $this->sessionMock->expects($this->atLeastOnce())->method('getCookiePath') - ->willReturn($result['cookie']['path']); - $this->sessionMock->expects($this->atLeastOnce())->method('getCookieDomain') - ->willReturn($result['cookie']['domain']); - $this->assertEquals($result, $this->imagesStorage->uploadFile($targetPath, $type)); } } diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index 38444de78ab9c..9019388dfec2d 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -96,17 +96,10 @@ public function execute() $relativePath = rtrim($tmpPath, '/') . '/' . ltrim($result['file'], '/'); $this->storageDatabase->saveFile($relativePath); } - - $result['cookie'] = [ - 'name' => $this->_getSession()->getName(), - 'value' => $this->_getSession()->getSessionId(), - 'lifetime' => $this->_getSession()->getCookieLifetime(), - 'path' => $this->_getSession()->getCookiePath(), - 'domain' => $this->_getSession()->getCookieDomain(), - ]; } catch (\Exception $e) { $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()]; } + return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData($result); } } diff --git a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php index df1f127fae313..281fb571ff56f 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Controller/Adminhtml/Downloadable/File/UploadTest.php @@ -59,11 +59,6 @@ class UploadTest extends \PHPUnit\Framework\TestCase */ protected $fileHelper; - /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Backend\Model\Session - */ - protected $session; - /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Controller\ResultFactory */ @@ -81,9 +76,6 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->session = $this->getMockBuilder(\Magento\Backend\Model\Session::class) - ->disableOriginalConstructor() - ->getMock(); $this->resultFactory = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) @@ -108,9 +100,6 @@ protected function setUp() $this->context->expects($this->any()) ->method('getRequest') ->will($this->returnValue($this->request)); - $this->context->expects($this->any()) - ->method('getSession') - ->will($this->returnValue($this->session)); $this->context->expects($this->any()) ->method('getResultFactory') ->will($this->returnValue($this->resultFactory)); @@ -154,11 +143,6 @@ public function testExecute() $this->uploaderFactory->expects($this->once())->method('create')->willReturn($uploader); $this->fileHelper->expects($this->once())->method('uploadFromTmp')->willReturn($data); $this->storageDatabase->expects($this->once())->method('saveFile'); - $this->session->expects($this->once())->method('getName')->willReturn('Name'); - $this->session->expects($this->once())->method('getSessionId')->willReturn('SessionId'); - $this->session->expects($this->once())->method('getCookieLifetime')->willReturn('CookieLifetime'); - $this->session->expects($this->once())->method('getCookiePath')->willReturn('CookiePath'); - $this->session->expects($this->once())->method('getCookieDomain')->willReturn('CookieDomain'); $this->resultFactory->expects($this->once())->method('create')->willReturn($resultJson); $resultJson->expects($this->once())->method('setData')->willReturnSelf(); diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index 82206b8eb1c65..eb0412738d1ea 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -127,14 +127,6 @@ public function uploadFile($targetPath) $this->_createThumbnail($targetPath . '/' . $uploader->getUploadedFileName()); - $result['cookie'] = [ - 'name' => $this->_helper->getSession()->getName(), - 'value' => $this->_helper->getSession()->getSessionId(), - 'lifetime' => $this->_helper->getSession()->getCookieLifetime(), - 'path' => $this->_helper->getSession()->getCookiePath(), - 'domain' => $this->_helper->getSession()->getCookieDomain() - ]; - return $result; } diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php index 0951f7b50f289..ddd6ebc43ce83 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -152,8 +152,7 @@ public function testUploadFile() $this->_helperStorage->expects($this->any())->method('getSession')->will($this->returnValue($session)); $expectedResult = [ - 'not_empty', - 'cookie' => ['name' => null, 'value' => null, 'lifetime' => null, 'path' => null, 'domain' => null], + 'not_empty' ]; $this->assertEquals($expectedResult, $this->_storageModel->uploadFile($this->_storageRoot)); From ed9f348f55cb7792bff56d4a89f1fa0dd292e0b5 Mon Sep 17 00:00:00 2001 From: roman Date: Mon, 17 Sep 2018 11:59:20 +0300 Subject: [PATCH 06/12] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 6 +++++- app/code/Magento/Theme/Model/Wysiwyg/Storage.php | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index 9019388dfec2d..a1d489046b144 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -1,6 +1,5 @@ Date: Tue, 18 Sep 2018 15:43:53 +0300 Subject: [PATCH 07/12] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index a1d489046b144..83b2797050db9 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -5,6 +5,7 @@ */ namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\File; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; /** @@ -12,7 +13,7 @@ * * @package Magento\Downloadable\Controller\Adminhtml\Downloadable\File */ -class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File +class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpPostActionInterface { /** * @var \Magento\Downloadable\Model\Link From e52c76486828f8c2eaec9c4c91566cd309124ed3 Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 18 Sep 2018 15:44:00 +0300 Subject: [PATCH 08/12] MAGETWO-72048: Wrong file upload behavior --- .../Catalog/Controller/Adminhtml/Category/Image/Upload.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php index e24b142411b83..d1efa0014d42d 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Image/Upload.php @@ -5,12 +5,13 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Category\Image; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; /** * Class Upload */ -class Upload extends \Magento\Backend\App\Action +class Upload extends \Magento\Backend\App\Action implements HttpPostActionInterface { /** * Image uploader From f4ec3348231b5bde57eea4643dacacc504f6662e Mon Sep 17 00:00:00 2001 From: roman Date: Tue, 18 Sep 2018 17:45:00 +0300 Subject: [PATCH 09/12] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index 83b2797050db9..c593651209047 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -5,7 +5,7 @@ */ namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\File; -use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\Controller\ResultFactory; /** @@ -13,7 +13,7 @@ * * @package Magento\Downloadable\Controller\Adminhtml\Downloadable\File */ -class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpPostActionInterface +class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpGetActionInterface { /** * @var \Magento\Downloadable\Model\Link From 6d6158e32105b2dd54894f1b172727d3741ea146 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun Date: Tue, 18 Sep 2018 18:23:05 +0300 Subject: [PATCH 10/12] MAGETWO-88591: Deleting Stores --- .../Controller/Adminhtml/System/Store/DeleteGroupPost.php | 8 ++++++-- .../Controller/Adminhtml/System/Store/DeleteStorePost.php | 7 +++++-- .../Adminhtml/System/Store/DeleteWebsitePost.php | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php index 23364aac1f0ab..49c327060dae5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteGroupPost.php @@ -1,16 +1,20 @@ Date: Tue, 18 Sep 2018 19:33:16 +0300 Subject: [PATCH 11/12] MAGETWO-88591: Deleting Stores --- .../Controller/Adminhtml/System/Store/DeleteWebsitePost.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php index f6f265a745500..3fee1a25c9fe4 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteWebsitePost.php @@ -8,6 +8,7 @@ use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; + /** * Delete website. */ From de61c15eab81fb049556c03dab1814a6cd33bcdb Mon Sep 17 00:00:00 2001 From: roman Date: Wed, 19 Sep 2018 16:09:35 +0300 Subject: [PATCH 12/12] MAGETWO-72048: Wrong file upload behavior --- .../Controller/Adminhtml/Downloadable/File/Upload.php | 4 ++-- .../Controller/Adminhtml/Downloadable/FileTest.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php index c593651209047..83b2797050db9 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php @@ -5,7 +5,7 @@ */ namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\File; -use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; /** @@ -13,7 +13,7 @@ * * @package Magento\Downloadable\Controller\Adminhtml\Downloadable\File */ -class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpGetActionInterface +class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpPostActionInterface { /** * @var \Magento\Downloadable\Model\Link diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php b/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php index 3f13ce7f41ed6..60c2a41fae49f 100644 --- a/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php +++ b/dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php @@ -37,6 +37,7 @@ public function testUploadAction() ], ]; + $this->getRequest()->setMethod('POST'); $this->dispatch('backend/admin/downloadable_file/upload/type/samples'); $body = $this->getResponse()->getBody(); $result = Bootstrap::getObjectManager()->get(Json::class)->unserialize($body); @@ -64,6 +65,7 @@ public function testUploadProhibitedExtensions($fileName) ], ]; + $this->getRequest()->setMethod('POST'); $this->dispatch('backend/admin/downloadable_file/upload/type/samples'); $body = $this->getResponse()->getBody(); $result = Bootstrap::getObjectManager()->get(Json::class)->unserialize($body);