Skip to content

Commit 0672919

Browse files
Merge MAGETWO-85121 into 2.2.8-bugfixes-090119
2 parents e942236 + b49f41b commit 0672919

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFolder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Cms\Controller\Adminhtml\Wysiwyg\Images;
88

99
use Magento\Framework\App\Filesystem\DirectoryList;
10+
use Magento\Framework\Exception\NotFoundException;
1011

1112
/**
1213
* Delete image folder.
@@ -57,6 +58,10 @@ public function __construct(
5758
*/
5859
public function execute()
5960
{
61+
if (!$this->getRequest()->isPost()) {
62+
throw new NotFoundException(__('Page not found'));
63+
}
64+
6065
try {
6166
$path = $this->getStorage()->getCmsWysiwygImages()->getCurrentPath();
6267
if (!$this->directoryResolver->validatePath($path, DirectoryList::MEDIA)) {

app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/NewFolder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Cms\Controller\Adminhtml\Wysiwyg\Images;
88

99
use Magento\Framework\App\Filesystem\DirectoryList;
10+
use Magento\Framework\Exception\NotFoundException;
1011

1112
/**
1213
* Creates new folder.
@@ -50,6 +51,10 @@ public function __construct(
5051
*/
5152
public function execute()
5253
{
54+
if (!$this->getRequest()->isPost()) {
55+
throw new NotFoundException(__('Page not found'));
56+
}
57+
5358
try {
5459
$this->_initAction();
5560
$name = $this->getRequest()->getPost('name');

dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/DeleteFolderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function testExecute()
5858
$this->mediaDirectory->getRelativePath($fullDirectoryPath . $directoryName)
5959
);
6060
$this->model->getRequest()->setParams(['node' => $this->imagesHelper->idEncode($directoryName)]);
61+
$this->model->getRequest()->setMethod('POST');
6162
$this->model->execute();
6263
$this->assertFalse(
6364
$this->mediaDirectory->isExist(

dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images/UploadTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public function testExecute()
7777
$this->mediaDirectory->create($this->mediaDirectory->getRelativePath($fullDirectoryPath));
7878

7979
$this->model->getRequest()->setParams(['type' => 'image/png']);
80+
$this->model->getRequest()->setMethod('POST');
8081
$this->model->getStorage()->getSession()->setCurrentPath($fullDirectoryPath);
8182
$this->model->execute();
8283
$this->assertTrue(

0 commit comments

Comments
 (0)