File tree Expand file tree Collapse file tree 3 files changed +8
-16
lines changed
Backup/Controller/Adminhtml/Index
ImportExport/Controller/Adminhtml/History
Wishlist/Controller/Index Expand file tree Collapse file tree 3 files changed +8
-16
lines changed Original file line number Diff line number Diff line change 66 */
77namespace Magento \Backup \Controller \Adminhtml \Index ;
88
9+ use Magento \Framework \App \Action \HttpGetActionInterface ;
910use Magento \Framework \App \Filesystem \DirectoryList ;
1011
11- class Download extends \Magento \Backup \Controller \Adminhtml \Index
12+ class Download extends \Magento \Backup \Controller \Adminhtml \Index implements HttpGetActionInterface
1213{
1314 /**
1415 * @var \Magento\Framework\Controller\Result\RawFactory
@@ -66,17 +67,12 @@ public function execute()
6667
6768 $ fileName = $ this ->_objectManager ->get (\Magento \Backup \Helper \Data::class)->generateBackupDownloadName ($ backup );
6869
69- $ this ->_fileFactory ->create (
70+ return $ this ->_fileFactory ->create (
7071 $ fileName ,
71- null ,
72+ $ backup -> output () ,
7273 DirectoryList::VAR_DIR ,
7374 'application/octet-stream ' ,
7475 $ backup ->getSize ()
7576 );
76-
77- /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
78- $ resultRaw = $ this ->resultRawFactory ->create ();
79- $ resultRaw ->setContents ($ backup ->output ());
80- return $ resultRaw ;
8177 }
8278}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public function __construct(
4747 */
4848 public function execute ()
4949 {
50+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
5051 $ fileName = basename ($ this ->getRequest ()->getParam ('filename ' ));
5152
5253 /** @var \Magento\ImportExport\Helper\Report $reportHelper */
@@ -59,17 +60,12 @@ public function execute()
5960 return $ resultRedirect ;
6061 }
6162
62- $ this ->fileFactory ->create (
63+ return $ this ->fileFactory ->create (
6364 $ fileName ,
64- null ,
65+ $ reportHelper -> getReportOutput ( $ fileName ) ,
6566 DirectoryList::VAR_IMPORT_EXPORT ,
6667 'application/octet-stream ' ,
6768 $ reportHelper ->getReportSize ($ fileName )
6869 );
69-
70- /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
71- $ resultRaw = $ this ->resultRawFactory ->create ();
72- $ resultRaw ->setContents ($ reportHelper ->getReportOutput ($ fileName ));
73- return $ resultRaw ;
7470 }
7571}
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ public function execute()
9797 $ secretKey = $ this ->getRequest ()->getParam ('key ' );
9898
9999 if ($ secretKey == $ info ['secret_key ' ]) {
100- $ this ->_fileResponseFactory ->create (
100+ return $ this ->_fileResponseFactory ->create (
101101 $ info ['title ' ],
102102 ['value ' => $ info ['quote_path ' ], 'type ' => 'filename ' ],
103103 DirectoryList::MEDIA ,
You can’t perform that action at this time.
0 commit comments