From c741ae2212a2a8f8b092cd6592dbbedd7e9d88ba Mon Sep 17 00:00:00 2001 From: Michael Milette Date: Sat, 27 Jun 2020 06:32:09 -0400 Subject: [PATCH] Notice: A non well formed numeric value encountered (#386) Eliminates the following PHP warnings when error reporting is turned on: Notice: A non well formed numeric value encountered in tinyfilemanager.php on line 2443 Notice: A non well formed numeric value encountered in tinyfilemanager.php on line 2444 This happens because PHP floor and round are expecting a (float), not an (int). --- tinyfilemanager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index eb5cc20..e39039d 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -2439,6 +2439,7 @@ function fm_get_size($file) */ function fm_get_filesize($size) { + $size = (float) $size; $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); $power = $size > 0 ? floor(log($size, 1024)) : 0; return sprintf('%s %s', round($size / pow(1024, $power), 2), $units[$power]);