Skip to content

Commit 913f67e

Browse files
committed
Merge remote-tracking branch 'trigger/MAGETWO-95633' into 2.3.0-qwerty-bugs
2 parents fa18a02 + da2b587 commit 913f67e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
* Class NotProtectedExtension
14+
*/
15+
class NotProtectedExtensionTest extends \PHPUnit\Framework\TestCase
16+
{
17+
/**
18+
* Test that phpt, pht is invalid extension type
19+
* @dataProvider isValidDataProvider
20+
*/
21+
public function testIsValid($extension)
22+
{
23+
$objectManager = Bootstrap::getObjectManager();
24+
/** @var \Magento\MediaStorage\Model\File\Validator\NotProtectedExtension $model */
25+
$model = $objectManager->create(\Magento\MediaStorage\Model\File\Validator\NotProtectedExtension::class);
26+
$this->assertFalse($model->isValid($extension));
27+
}
28+
29+
public function isValidDataProvider()
30+
{
31+
return [
32+
['phpt'],
33+
['pht']
34+
];
35+
}
36+
}

0 commit comments

Comments
 (0)