Revize c478920d
Přidáno uživatelem Ondřej Fibich před asi 9 roky(ů)
application/helpers/file.php | ||
---|---|---|
$p = explode('.',$filename);
|
||
return strtolower($p[count($p)-1]);
|
||
}
|
||
|
||
public static function shortened_size_to_bytes($size)
|
||
{
|
||
$size = strtolower($size);
|
||
$last = substr($size, -1);
|
||
if ($last == 'b')
|
||
{
|
||
$size = substr($size, 0, -1);
|
||
}
|
||
|
||
$last = substr($size, -1);
|
||
switch ($last)
|
||
{
|
||
case 't':
|
||
$size *= 1024;
|
||
case 'g':
|
||
$size *= 1024;
|
||
case 'm':
|
||
$size *= 1024;
|
||
case 'k':
|
||
$size *= 1024;
|
||
}
|
||
|
||
return $size;
|
||
}
|
||
|
||
} // End file
|
Také k dispozici: Unified diff
Undo my stupid mistake (I have pushed issue-957 to master instead of develop). Do I have copied files from GitHub master and push them back..