diff options
-rw-r--r-- | it.class | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -753,6 +753,14 @@ static function cdist(...$args) $files = array_merge((array)$files, (array)$arg); } + # no files: return early, don't execute cdist -q '' + if (!is_array($files) || !count($files)) + return true; + + # Check for invalid file names + if (in_array(false, $files, true) || in_array(null, $files, true)) + return it::error("invalid file name(s)"); + return ($errs = it::exec('cdist -q {-opts} {files} 2>&1', ['-opts' => $opts, 'files' => $files])) ? it::error(['title' => $errs]) : true; } |