diff --git a/index.php b/index.php index 26eb8b970e73d82d16cd86cc25f544662f0ce0e5..fff1a99ec973d14639782e5d20efe361afa31e57 100644 --- a/index.php +++ b/index.php @@ -67,13 +67,14 @@ function human_filesize($bytes, $decimals = 2) return ''; } - $sz = 'BKMGTP'; - $factor = floor((strlen($bytes) - 1) / 3); - $suff = @$sz[$factor]; - if ($suff != 'B') { - $suff .= 'iB'; + $sizes = 'BKMGTP'; + $factor = floor((strlen($bytes) - 1) / 3) ?: 0; + $suffix = @$sizes[$factor]; + if ($suffix === 'B') { + return "{$bytes}B"; } - return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . $suff; + + return sprintf("%.{$decimals}f", $bytes / (1024 ** $factor)) . "{$suffix}iB"; } function get_dl_link($flavor, $version, $file = null) @@ -162,7 +163,7 @@ save_binaries_json($files, $stable); -

Frequently Asked Questions

+

Frequently Asked Questions

Which version should I choose?

There is probably only one version that's going to run on your device. Run uname -m and choose the version that's named similar to the output. @@ -192,7 +193,7 @@ save_binaries_json($files, $stable); Yes, but please use this JSON representation in stead of this website. Also, please note that excessive polling might get you banned.
-

Archive

+

Archive

(show unstable builds)