파일 크기 제한, 문서 첨부 제한 설정 오류 수정

upload_max_filesize가 MB단위로 되어있지 않은 경우(ex. 2G) 발생하던 오류를 수정했습니다.
This commit is contained in:
lsc2687 2016-08-30 20:12:22 +09:00 committed by Kijin Sung
parent b0dde0c044
commit 6438927f7e

View file

@ -175,7 +175,12 @@ class fileModel extends file
if(!$config->allow_outlink) $config->allow_outlink = 'Y';
if(!$config->download_grant) $config->download_grant = array();
$size = preg_replace('/[a-z]/is', '', ini_get('upload_max_filesize'));
$size = ini_get('upload_max_filesize');
$unit = strtolower($size[strlen($size) - 1]);
$size = (float)$size;
if($unit == 'g') $size *= 1024;
if($unit == 'k') $size /= 1024;
if($config->allowed_filesize > $size)
{
$config->allowed_filesize = $size;