mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Fix incorrect parsing of allowed_extensions in file upload config
https://xetown.com/questions/1523089
This commit is contained in:
parent
a4ab4f4b03
commit
aba959f673
1 changed files with 6 additions and 2 deletions
|
|
@ -102,7 +102,9 @@ class fileAdminController extends file
|
|||
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||
if ($config->allowed_extensions)
|
||||
{
|
||||
$config->allowed_extensions = array_map('trim', explode(',', $config->allowed_filetypes));
|
||||
$config->allowed_extensions = array_filter(array_map('trim', explode(',', $config->allowed_extensions)), function($str) {
|
||||
return $str !== '*';
|
||||
});
|
||||
$config->allowed_filetypes = implode(';', array_map(function($ext) {
|
||||
return '*.' . $ext;
|
||||
}, $config->allowed_extensions));
|
||||
|
|
@ -188,7 +190,9 @@ class fileAdminController extends file
|
|||
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||
if ($config->allowed_extensions)
|
||||
{
|
||||
$config->allowed_extensions = array_map('trim', explode(',', $config->allowed_filetypes));
|
||||
$config->allowed_extensions = array_filter(array_map('trim', explode(',', $config->allowed_extensions)), function($str) {
|
||||
return $str !== '*';
|
||||
});
|
||||
$config->allowed_filetypes = implode(';', array_map(function($ext) {
|
||||
return '*.' . $ext;
|
||||
}, $config->allowed_extensions));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue