File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
app/code/Magento/Catalog/Model/Product/Option/Type/File Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 2020 */
2121class ValidatorInfo extends Validator
2222{
23+ /**
24+ * @var string
25+ */
26+ private const PATH_PREFIX = 'custom_options ' ;
27+
2328 /**
2429 * @var Database
2530 */
@@ -49,6 +54,7 @@ class ValidatorInfo extends Validator
4954 * @var IoFile
5055 */
5156 private $ ioFile ;
57+
5258 /**
5359 * @var NotProtectedExtension
5460 */
@@ -146,13 +152,19 @@ public function validate($optionValue, $option)
146152 private function validatePath (array $ optionValuePath ): bool
147153 {
148154 foreach ([$ optionValuePath ['quote_path ' ], $ optionValuePath ['order_path ' ]] as $ path ) {
155+ if (strpos ($ path , self ::PATH_PREFIX ) !== 0 ) {
156+ return false ;
157+ }
158+
149159 $ pathInfo = $ this ->ioFile ->getPathInfo ($ path );
150- if (isset ($ pathInfo ['extension ' ])) {
151- if (!$ this ->fileValidator ->isValid ($ pathInfo ['extension ' ])) {
152- return false ;
153- }
160+
161+ if (isset ($ pathInfo ['extension ' ])
162+ && ($ pathInfo ['extension ' ] === '' || !$ this ->fileValidator ->isValid ($ pathInfo ['extension ' ]))
163+ ) {
164+ return false ;
154165 }
155166 }
167+
156168 return true ;
157169 }
158170
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Options -Indexes
1111AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
1212Options -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?)$" >
1515SetHandler default-handler
1616</FilesMatch >
1717
You can’t perform that action at this time.
0 commit comments