Skip to content

Commit bad843e

Browse files
Merge branch 'AC-11831' into cia-2.4.8-beta1-develop-bugfix-06172024
2 parents 37bd1d9 + bb4572f commit bad843e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
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

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)