From 8d76a6b849309c6fe6a1dfeb198183488edc99e0 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Thu, 29 Apr 2021 10:44:48 +0200 Subject: [PATCH] ncp-web: fix display of big files for 32 bit Signed-off-by: nachoparker --- changelog.md | 16 ++++++++++++++-- ncp-web/backups.php | 10 +++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 33852676..82c7e6e2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,17 @@ -[v1.34.7](https://github.com/nextcloud/nextcloudpi/commit/0cce679) (2021-01-19) docker: fix datadir path contents +[v1.35.2](https://github.com/nextcloud/nextcloudpi/commit/3f345eb) (2021-04-29) ncp-web: fix display of big files for 32 bit -[v1.34.6](https://github.com/nextcloud/nextcloudpi/commit/84ccf94) (2021-01-18) docker: fix datadir path +[v1.35.1 ](https://github.com/nextcloud/nextcloudpi/commit/e64ca34) (2021-04-29) ncp-web: fix backup download for big files in 32-bit + +[v1.35.0](https://github.com/nextcloud/nextcloudpi/commit/be30663) (2021-02-27) upgrade to NC20.0.8 + +[v1.34.9 ](https://github.com/nextcloud/nextcloudpi/commit/7d15924) (2021-01-19) nc-autoupdate-ncp: Append to log instead of replace + +[v1.34.8 ](https://github.com/nextcloud/nextcloudpi/commit/117b8ea) (2021-01-20) nc-automount: udiskie verbose output + +[v1.34.7, master](https://github.com/nextcloud/nextcloudpi/commit/b978184) (2021-01-19) docker: fix datadir path contents + +[v1.34.6 ](https://github.com/nextcloud/nextcloudpi/commit/84ccf94) (2021-01-18) docker: fix datadir path [v1.34.5 ](https://github.com/nextcloud/nextcloudpi/commit/afa39fb) (2021-01-18) ncp-config: shorten descriptions @@ -35,6 +45,8 @@ [v1.29.8 ](https://github.com/nextcloud/nextcloudpi/commit/21a791d) (2020-08-30) nc-limits: minimum 6 PHP threads (for NC talk) +[v1.29.7 ](https://github.com/nextcloud/nextcloudpi/commit/c143acc) (2020-07-24) do not hsts preload by default, only serve hsts header over https + [v1.29.6 ](https://github.com/nextcloud/nextcloudpi/commit/14b78e3) (2020-08-29) ncp-web: Fix the style of the language selection dropdown (chrome) [v1.29.5 ](https://github.com/nextcloud/nextcloudpi/commit/34e84ba) (2020-08-30) ncp-web: fix initial screen displaying all sections 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;