- file::_changeBytes()를 FIleHandler::returnBytes()로 대체
This commit is contained in:
bnu 2015-01-30 17:36:14 +09:00
parent ae55711dc4
commit 14ffdbe5f0
6 changed files with 17 additions and 41 deletions

View file

@ -635,18 +635,13 @@ class FileHandler
*/
function returnBytes($val)
{
$last = strtolower(substr(trim($val), -1));
switch ($last)
$unit = strtoupper(substr($val, -1));
$val = (int)$val;
switch ($unit)
{
case 'g':
$val *= 1024 * 1024 * 1024;
break;
case 'm':
$val *= 1024 * 1024;
break;
case 'k':
$val *= 1024;
break;
case 'G': $val *= 1024;
case 'M': $val *= 1024;
case 'K': $val *= 1024;
}
return $val;