Skip to content

Commit 13bfc7c

Browse files
author
mcramer
committed
Bugfix: Spaces need to be deleted before cron save, because they are IGNORED on validation but lead to a non-functional cron.
Storing minute / hour / etc. values like "1, 23, 26" (with spaces) is allowed in validation and interface but leads to a BLOCKED crontab file and to non-functional crons of the whole web user.
1 parent 4b9329a commit 13bfc7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/plugins-available/cron_plugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function _write_crontab() {
198198
if($job['run_month'] == '@reboot') {
199199
$command = "@reboot";
200200
} else {
201-
$command = "{$job['run_min']}\t{$job['run_hour']}\t{$job['run_mday']}\t{$job['run_month']}\t{$job['run_wday']}";
201+
$command = str_replace(" ", "", $job['run_min']) . "\t" . str_replace(" ", "", $job['run_hour']) . "\t" . str_replace(" ", "", $job['run_mday']) . "\t" . str_replace(" ", "", $job['run_month']) . "\t" . str_replace(" ", "", $job['run_wday']);
202202
}
203203
$command .= "\t{$this->parent_domain['system_user']}"; //* running as user
204204
if($job['type'] == 'url') {

0 commit comments

Comments
 (0)