mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +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('*.' => '', ';' => ','));
|
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||||
if ($config->allowed_extensions)
|
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) {
|
$config->allowed_filetypes = implode(';', array_map(function($ext) {
|
||||||
return '*.' . $ext;
|
return '*.' . $ext;
|
||||||
}, $config->allowed_extensions));
|
}, $config->allowed_extensions));
|
||||||
|
|
@ -188,7 +190,9 @@ class fileAdminController extends file
|
||||||
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||||
if ($config->allowed_extensions)
|
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) {
|
$config->allowed_filetypes = implode(';', array_map(function($ext) {
|
||||||
return '*.' . $ext;
|
return '*.' . $ext;
|
||||||
}, $config->allowed_extensions));
|
}, $config->allowed_extensions));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue