File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed
app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images
dev/tests/integration/testsuite/Magento/Cms/Controller/Adminhtml/Wysiwyg/Images Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 7
7
namespace Magento \Cms \Controller \Adminhtml \Wysiwyg \Images ;
8
8
9
9
use Magento \Framework \App \Filesystem \DirectoryList ;
10
+ use Magento \Framework \Exception \NotFoundException ;
10
11
11
12
/**
12
13
* Delete image folder.
@@ -57,6 +58,10 @@ public function __construct(
57
58
*/
58
59
public function execute ()
59
60
{
61
+ if (!$ this ->getRequest ()->isPost ()) {
62
+ throw new NotFoundException (__ ('Page not found ' ));
63
+ }
64
+
60
65
try {
61
66
$ path = $ this ->getStorage ()->getCmsWysiwygImages ()->getCurrentPath ();
62
67
if (!$ this ->directoryResolver ->validatePath ($ path , DirectoryList::MEDIA )) {
Original file line number Diff line number Diff line change 7
7
namespace Magento \Cms \Controller \Adminhtml \Wysiwyg \Images ;
8
8
9
9
use Magento \Framework \App \Filesystem \DirectoryList ;
10
+ use Magento \Framework \Exception \NotFoundException ;
10
11
11
12
/**
12
13
* Creates new folder.
@@ -50,6 +51,10 @@ public function __construct(
50
51
*/
51
52
public function execute ()
52
53
{
54
+ if (!$ this ->getRequest ()->isPost ()) {
55
+ throw new NotFoundException (__ ('Page not found ' ));
56
+ }
57
+
53
58
try {
54
59
$ this ->_initAction ();
55
60
$ name = $ this ->getRequest ()->getPost ('name ' );
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ public function testExecute()
58
58
$ this ->mediaDirectory ->getRelativePath ($ fullDirectoryPath . $ directoryName )
59
59
);
60
60
$ this ->model ->getRequest ()->setParams (['node ' => $ this ->imagesHelper ->idEncode ($ directoryName )]);
61
+ $ this ->model ->getRequest ()->setMethod ('POST ' );
61
62
$ this ->model ->execute ();
62
63
$ this ->assertFalse (
63
64
$ this ->mediaDirectory ->isExist (
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ public function testExecute()
77
77
$ this ->mediaDirectory ->create ($ this ->mediaDirectory ->getRelativePath ($ fullDirectoryPath ));
78
78
79
79
$ this ->model ->getRequest ()->setParams (['type ' => 'image/png ' ]);
80
+ $ this ->model ->getRequest ()->setMethod ('POST ' );
80
81
$ this ->model ->getStorage ()->getSession ()->setCurrentPath ($ fullDirectoryPath );
81
82
$ this ->model ->execute ();
82
83
$ this ->assertTrue (
You can’t perform that action at this time.
0 commit comments