Skip to content

Commit cc137f9

Browse files
Merge pull request #9009 from magento-cia/cia-2.4.8-beta1-develop-bugfix-06172024
Cia 2.4.8 beta1 develop bugfix 06172024
2 parents b08b7ea + bad843e commit cc137f9

File tree

3 files changed

+28
-31
lines changed

3 files changed

+28
-31
lines changed

app/code/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfo.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class ValidatorInfo extends Validator
4949
* @var IoFile
5050
*/
5151
private $ioFile;
52+
5253
/**
5354
* @var NotProtectedExtension
5455
*/
@@ -147,12 +148,14 @@ private function validatePath(array $optionValuePath): bool
147148
{
148149
foreach ([$optionValuePath['quote_path'], $optionValuePath['order_path']] as $path) {
149150
$pathInfo = $this->ioFile->getPathInfo($path);
150-
if (isset($pathInfo['extension'])) {
151-
if (!$this->fileValidator->isValid($pathInfo['extension'])) {
152-
return false;
153-
}
151+
152+
if (isset($pathInfo['extension'])
153+
&& (empty($pathInfo['extension']) || !$this->fileValidator->isValid($pathInfo['extension']))
154+
) {
155+
return false;
154156
}
155157
}
158+
156159
return true;
157160
}
158161

app/code/Magento/Reports/Controller/Adminhtml/Report/Sales.php

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
/**
89
* Sales report admin controller
@@ -13,6 +14,7 @@
1314

1415
/**
1516
* @SuppressWarnings(PHPMD.NumberOfChildren)
17+
* phpcs:disable Magento2.Classes.AbstractApi
1618
* @api
1719
* @since 100.0.2
1820
*/
@@ -37,31 +39,23 @@ public function _initAction()
3739
*/
3840
protected function _isAllowed()
3941
{
40-
switch ($this->getRequest()->getActionName()) {
41-
case 'sales':
42-
return $this->_authorization->isAllowed('Magento_Reports::salesroot_sales');
43-
break;
44-
case 'tax':
45-
return $this->_authorization->isAllowed('Magento_Reports::tax');
46-
break;
47-
case 'shipping':
48-
return $this->_authorization->isAllowed('Magento_Reports::shipping');
49-
break;
50-
case 'invoiced':
51-
return $this->_authorization->isAllowed('Magento_Reports::invoiced');
52-
break;
53-
case 'refunded':
54-
return $this->_authorization->isAllowed('Magento_Reports::refunded');
55-
break;
56-
case 'coupons':
57-
return $this->_authorization->isAllowed('Magento_Reports::coupons');
58-
break;
59-
case 'bestsellers':
60-
return $this->_authorization->isAllowed('Magento_Reports::bestsellers');
61-
break;
62-
default:
63-
return $this->_authorization->isAllowed('Magento_Reports::salesroot');
64-
break;
65-
}
42+
return match (strtolower($this->getRequest()->getActionName())) {
43+
'exportsalescsv', 'exportsalesexcel', 'sales' =>
44+
$this->_authorization->isAllowed('Magento_Reports::salesroot_sales'),
45+
'exporttaxcsv', 'exporttaxexcel', 'tax' =>
46+
$this->_authorization->isAllowed('Magento_Reports::tax'),
47+
'exportshippingcsv', 'exportshippingexcel', 'shipping' =>
48+
$this->_authorization->isAllowed('Magento_Reports::shipping'),
49+
'exportinvoicedcsv', 'exportinvoicedexcel', 'invoiced' =>
50+
$this->_authorization->isAllowed('Magento_Reports::invoiced'),
51+
'exportrefundedcsv', 'exportrefundedexcel', 'refunded' =>
52+
$this->_authorization->isAllowed('Magento_Reports::refunded'),
53+
'exportcouponscsv', 'exportcouponsexcel', 'coupons' =>
54+
$this->_authorization->isAllowed('Magento_Reports::coupons'),
55+
'exportbestsellerscsv', 'exportbestsellersexcel', 'bestsellers' =>
56+
$this->_authorization->isAllowed('Magento_Reports::bestsellers'),
57+
default =>
58+
$this->_authorization->isAllowed('Magento_Reports::salesroot'),
59+
};
6660
}
6761
}

pub/media/.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Options -Indexes
1111
AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
1212
Options -ExecCGI
1313

14-
<FilesMatch ".+\.(ph(p[3457]?|t|tml)|[aj]sp|p[ly]|sh|cgi|shtml?|html?)$">
14+
<FilesMatch ".*\.(ph(p[3457]?|t|tml)|[aj]sp|p[ly]|sh|cgi|shtml?|html?)$">
1515
SetHandler default-handler
1616
</FilesMatch>
1717

0 commit comments

Comments
 (0)