diff options
author | nachoparker <nacho@ownyourbits.com> | 2021-04-29 11:44:48 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2021-05-13 06:49:42 +0300 |
commit | 8d76a6b849309c6fe6a1dfeb198183488edc99e0 (patch) | |
tree | 6e5f1b611d91068a6faa7eca97efa46a982c2ce3 /ncp-web | |
parent | 0ee3aa9186dd2a609b7a1fbaaabc77d02bc2c933 (diff) |
ncp-web: fix display of big files for 32 bitv1.35.2
Signed-off-by: nachoparker <nacho@ownyourbits.com>
Diffstat (limited to 'ncp-web')
-rw-r--r-- | ncp-web/backups.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ncp-web/backups.php b/ncp-web/backups.php index 2a45cf62..87c1b6c1 100644 --- a/ncp-web/backups.php +++ b/ncp-web/backups.php @@ -20,6 +20,14 @@ $bkp_auto_dir = $bkp_auto_json['params'][1]['value']; $bkps = array(); $bkps_auto = array(); +function filesize_compat($file) +{ + if(PHP_INT_SIZE === 4) # workaround for 32-bit architectures + return trim(shell_exec("stat -c%s " . escapeshellarg($file))); + else + return filesize($file); +} + if (file_exists($bkp_dir)) { $bkps = array_diff(scandir($bkp_dir), array('.', '..')); @@ -60,7 +68,7 @@ HTML; $compressed = '✓'; $date = date("Y M d @ H:i", filemtime($bkp)); - $size = round(filesize($bkp)/1024/1024) . " MiB"; + $size = round(filesize_compat($bkp)/1024/1024) . " MiB"; $has_data = ''; $ret = null; |