From 13bfc7cd321fad7e20cd2f49ddaaa0eb01527896 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Fri, 8 Jun 2012 20:34:35 +0000
Subject: [PATCH] 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.

---
 server/plugins-available/cron_plugin.inc.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/plugins-available/cron_plugin.inc.php b/server/plugins-available/cron_plugin.inc.php
index 3ec4717185..23dbc28cd5 100644
--- a/server/plugins-available/cron_plugin.inc.php
+++ b/server/plugins-available/cron_plugin.inc.php
@@ -198,7 +198,7 @@ class cron_plugin {
 				if($job['run_month'] == '@reboot') {
 					$command = "@reboot";
 				} else {
-					$command = "{$job['run_min']}\t{$job['run_hour']}\t{$job['run_mday']}\t{$job['run_month']}\t{$job['run_wday']}";
+					$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']);
                 }
 				$command .= "\t{$this->parent_domain['system_user']}"; //* running as user
                 if($job['type'] == 'url') {
-- 
GitLab