Enforce allowed filesize and type in extra var upload form

This commit is contained in:
Kijin Sung 2024-10-09 11:36:14 +09:00
parent 7fe2203cbd
commit 3ffeb63afb
3 changed files with 23 additions and 2 deletions

View file

@ -472,9 +472,12 @@ class FileModel extends File
*
* @return object Returns a file configuration of current module. If user is admin, returns PHP's max file size and allow all file types.
*/
public static function getUploadConfig()
public static function getUploadConfig($module_srl = 0)
{
$module_srl = Context::get('module_srl') ?: (Context::get('current_module_info')->module_srl ?? 0);
if (!$module_srl)
{
$module_srl = Context::get('module_srl') ?: (Context::get('current_module_info')->module_srl ?? 0);
}
$config = self::getFileConfig($module_srl);
if (Rhymix\Framework\Session::isAdmin())
{