From 11bcc4092307b0aade315af02107516a353dd403 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Sun, 4 Nov 2018 14:20:58 +0100 Subject: [PATCH] Change file size retrieval to use PHP functions as shell exec has never worked here because of the douple escapeshellargs --- packages/web/lib/fog/fogbase.class.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/web/lib/fog/fogbase.class.php b/packages/web/lib/fog/fogbase.class.php index 548b6b14a7..18bc11426e 100644 --- a/packages/web/lib/fog/fogbase.class.php +++ b/packages/web/lib/fog/fogbase.class.php @@ -2302,11 +2302,8 @@ public static function lasterror() */ public static function getFilesize($file) { - $file = escapeshellarg($file); - - return trim( - shell_exec("du -b $file | awk '{print $1}'") - ); + $size = filesize($file); + return isset($size) ? $size : 0; } /** * Perform enmass wake on lan. @@ -2420,7 +2417,6 @@ public static function fastmerge($array1) */ public static function getHash($file) { - $file = escapeshellarg($file); $filesize = self::getFilesize($file); $fp = fopen($file, 'r'); if ($fp) {