Do not cast hard drive size to integer - fixes #1037
This commit is contained in:
parent
b3eb5e7b03
commit
08b01502a5
2 changed files with 5 additions and 3 deletions
|
@ -488,7 +488,7 @@ function parse_shorthand_int(string $limit): int
|
||||||
/**
|
/**
|
||||||
* Turn an integer into a human readable filesize, eg 1024 -> 1KB
|
* Turn an integer into a human readable filesize, eg 1024 -> 1KB
|
||||||
*/
|
*/
|
||||||
function to_shorthand_int(int $int): string
|
function to_shorthand_int(int|float $int): string
|
||||||
{
|
{
|
||||||
assert($int >= 0);
|
assert($int >= 0);
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,8 @@ class ET extends Extension
|
||||||
$ver .= "+";
|
$ver .= "+";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$disk_total = false_throws(disk_total_space("./"));
|
||||||
|
$disk_free = false_throws(disk_free_space("./"));
|
||||||
$info = [
|
$info = [
|
||||||
"about" => [
|
"about" => [
|
||||||
'title' => $config->get_string(SetupConfig::TITLE),
|
'title' => $config->get_string(SetupConfig::TITLE),
|
||||||
|
@ -103,8 +105,8 @@ class ET extends Extension
|
||||||
],
|
],
|
||||||
"media" => [
|
"media" => [
|
||||||
"memory_limit" => to_shorthand_int($config->get_int(MediaConfig::MEM_LIMIT)),
|
"memory_limit" => to_shorthand_int($config->get_int(MediaConfig::MEM_LIMIT)),
|
||||||
"disk_use" => to_shorthand_int((int)disk_total_space("./") - (int)disk_free_space("./")),
|
"disk_use" => to_shorthand_int($disk_total - $disk_free),
|
||||||
"disk_total" => to_shorthand_int((int)disk_total_space("./")),
|
"disk_total" => to_shorthand_int($disk_total),
|
||||||
],
|
],
|
||||||
"thumbnails" => [
|
"thumbnails" => [
|
||||||
"engine" => $config->get_string(ImageConfig::THUMB_ENGINE),
|
"engine" => $config->get_string(ImageConfig::THUMB_ENGINE),
|
||||||
|
|
Reference in a new issue