Ver Fonte

Update user_dashboard.php (#2392)

Calling which via php-fpm on centos returns null.
CentOS has df in path for nginx/php-fpm scrtips.
Adam Niedzwiedzki há 8 anos atrás
pai
commit
bd479761d1
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      core/user_settings/user_dashboard.php

+ 5 - 1
core/user_settings/user_dashboard.php

@@ -939,7 +939,11 @@
 			//disk usage
 			//disk usage
 			if (stristr(PHP_OS, 'Linux')) {
 			if (stristr(PHP_OS, 'Linux')) {
 				$df = shell_exec("/usr/bin/which df");
 				$df = shell_exec("/usr/bin/which df");
-				$tmp = shell_exec($df." /home 2>&1");
+				if($df){
+					$tmp = shell_exec($df." /home 2>&1");
+				} else {
+					$tmp = shell_exec("df /home 2>&1");
+				}
 				$tmp = explode("\n", $tmp);
 				$tmp = explode("\n", $tmp);
 				$tmp = preg_replace('!\s+!', ' ', $tmp[1]); // multiple > single space
 				$tmp = preg_replace('!\s+!', ' ', $tmp[1]); // multiple > single space
 				$tmp = explode(' ', $tmp);
 				$tmp = explode(' ', $tmp);