Getting directory sizes with du - use escapeshellarg on the file/directory as unzipping files on the server can result in filenames that need escaping
This commit is contained in:
+1
-1
@@ -4051,7 +4051,7 @@ function get_directory_size($rootdir, $excludefile='') {
|
||||
|
||||
// do it this way if we can, it's much faster
|
||||
if (!empty($CFG->pathtodu) && is_executable(trim($CFG->pathtodu))) {
|
||||
$command = trim($CFG->pathtodu).' -sk --apparent-size '.$rootdir;
|
||||
$command = trim($CFG->pathtodu).' -sk --apparent-size '.escapeshellarg($rootdir);
|
||||
exec($command,$output,$return);
|
||||
if (is_array($output)) {
|
||||
return get_real_size(intval($output[0]).'k'); // we told it to return k.
|
||||
|
||||
Reference in New Issue
Block a user