Skip to content

Commit 5a77099

Browse files
committed
MAGETWO-95635: Updating default value for protected_extensions setting
1 parent a2afbc3 commit 5a77099

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

app/code/Magento/Store/etc/config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
<html>html</html>
131131
<phtml>phtml</phtml>
132132
<shtml>shtml</shtml>
133+
<phpt>phpt</phpt>
134+
<pht>pht</pht>
133135
</protected_extensions>
134136
<public_files_valid_paths>
135137
<protected>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Framework\Code\File\Validator;
9+
10+
use Magento\TestFramework\Helper\Bootstrap;
11+
12+
/**
13+
* Tests protected extensions.
14+
*/
15+
class NotProtectedExtensionTest extends \PHPUnit\Framework\TestCase
16+
{
17+
/**
18+
* Tests that phpt, pht are invalid extension types.
19+
*
20+
* @dataProvider isValidDataProvider
21+
*/
22+
public function testIsValid($extension)
23+
{
24+
$objectManager = Bootstrap::getObjectManager();
25+
/** @var \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $model */
26+
$model = $objectManager->create(\Magento\MediaStorage\Model\File\Validator\NotProtectedExtension::class);
27+
$this->assertFalse($model->isValid($extension));
28+
}
29+
30+
public function isValidDataProvider()
31+
{
32+
return [
33+
['phpt'],
34+
['pht'],
35+
];
36+
}
37+
}

0 commit comments

Comments
 (0)