mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-28 14:52:24 +09:00
Simplify allowed_filetypes input format
This commit is contained in:
parent
8c242327a8
commit
c40a47724d
11 changed files with 61 additions and 25 deletions
|
|
@ -881,16 +881,9 @@ class fileController extends file
|
|||
{
|
||||
|
||||
// Check file type
|
||||
if(isset($config->allowed_filetypes) && $config->allowed_filetypes !== '*.*')
|
||||
if(isset($config->allowed_extensions) && count($config->allowed_extensions))
|
||||
{
|
||||
$filetypes = explode(';', $config->allowed_filetypes);
|
||||
$ext = array();
|
||||
foreach($filetypes as $item) {
|
||||
$item = explode('.', $item);
|
||||
$ext[] = strtolower($item[1]);
|
||||
}
|
||||
|
||||
if(!in_array($extension, $ext))
|
||||
if(!in_array($extension, $config->allowed_extensions))
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_not_allowed_filetype');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue