From 1b365d4fb7c96f5ede9f889074618b21983ede3b Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 23 May 2026 17:12:58 -0400 Subject: [PATCH] Fix conf array parser stopping early at ) in comments Non-greedy (.*?) stopped at the first ) found, which could be inside a comment like '# gracefully stop fallback (not caught by ...)'. Anchoring the closing paren to start-of-line (^\s*\)) ensures it only matches the array's actual closing paren, not ) inside comment text. --- Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php b/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php index 5c03682..18605ce 100644 --- a/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php +++ b/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php @@ -82,7 +82,7 @@ function vv_job_tree(): array { // Parse a bash array from master.conf content and return its script paths. // Handles entries with inline args ("script.sh --flag") and skips commented lines (#"..."). function vv_parse_conf_array(string $conf, string $varName): array { - if (!preg_match('/^\s*' . preg_quote($varName, '/') . '\s*=\s*\((.*?)\)/ms', $conf, $m)) { + if (!preg_match('/^\s*' . preg_quote($varName, '/') . '\s*=\s*\((.*?)^\s*\)/ms', $conf, $m)) { return []; } $scripts = [];