mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-06 01:31:14 -04:00
Add safety check on PHP options lookup.
This commit is contained in:
parent
6ad53ec2aa
commit
509074c263
6 changed files with 26 additions and 23 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue