1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-24 15:13:04 +02:00

Checking of remote file-types during import and other cleanup.

This commit is contained in:
Cameron
2021-12-17 11:31:37 -08:00
parent d8ce385929
commit 90108eab3c
6 changed files with 34 additions and 9 deletions

View File

@@ -152,8 +152,14 @@ class e_fileTest extends \Codeception\Test\Unit
$isAllowedTest = array(
array('path'=> 'somefile.bla', 'expected' => false), // suspicious
array('path'=> e_SYSTEM."filetypes.xml", 'expected' => true), // okay
array('path'=> e_PLUGIN."gallery/images/butterfly.jpg", 'expected' => true), // okay
array('path'=> 'somefile.php', 'expected' => false), // suspicious
array('path'=> 'somefile.exe', 'expected' => false), // suspicious
array('path'=> e_SYSTEM."filetypes.xml", 'expected' => true), // permitted
array('path'=> e_PLUGIN."gallery/images/butterfly.jpg", 'expected' => true), // permitted
array('path'=> 'http://127.0.0.1:8070/file.svg', 'expected'=>false), // not permitted
array('path'=> 'http://127.0.0.1:8070/butterfly.jpg', 'expected'=>true), // permitted
array('path'=> 'http://127.0.0.1/bla.php', 'expected'=>false), // suspicious
array('path'=> 'http://127.0.0.1/bla.php?butterfly.jpg', 'expected'=>false), // suspicious
);
foreach($isAllowedTest as $file)