Add safety check on PHP options lookup.

This commit is contained in:
Lars Jung 2015-05-02 01:44:50 +02:00
parent 6ad53ec2aa
commit 509074c263
6 changed files with 26 additions and 23 deletions

View file

@ -171,8 +171,8 @@ class Util {
} else if (is_dir($path)) {
$options = $app->get_options();
if ($options["foldersize"]["enabled"]) {
if (HAS_CMD_DU && $options["foldersize"]["type"] === "shell-du") {
if ($app->get_option("foldersize.enabled", false)) {
if (HAS_CMD_DU && $app->get_option("foldersize.type", null) === "shell-du") {
$cmdv = array("du", "-sk", $path);
$size = intval(preg_replace("#\s.*$#", "", Util::exec_cmdv($cmdv)), 10) * 1024;
} else {