Skip to content

Commit dc97fec

Browse files
committed
Rename command to cron_line, as it's not a command
1 parent f36aaf2 commit dc97fec

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

server/plugins-available/cron_plugin.inc.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ function _write_crontab() {
219219
if($cron_jobs && count($cron_jobs) > 0) {
220220
foreach($cron_jobs as $job) {
221221
if($job['run_month'] == '@reboot') {
222-
$command = "@reboot";
222+
$cron_line = "@reboot";
223223
} else {
224-
$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']);
224+
$cron_line = 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']);
225225
}
226226

227227
$log_target = ">/dev/null 2>&1";
@@ -235,9 +235,9 @@ function _write_crontab() {
235235
$log_wget_target = $log_root . '/cron_wget.log';
236236
}
237237

238-
$command .= "\t{$this->parent_domain['system_user']}"; //* running as user
238+
$cron_line .= "\t{$this->parent_domain['system_user']}"; //* running as user
239239
if($job['type'] == 'url') {
240-
$command .= "\t{$cron_config['wget']} --no-check-certificate --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' -q -t 1 -T 7200 -O " . $log_wget_target . " " . escapeshellarg($job['command']) . " " . $log_target;
240+
$cron_line .= "\t{$cron_config['wget']} --no-check-certificate --user-agent='Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0' -q -t 1 -T 7200 -O " . $log_wget_target . " " . escapeshellarg($job['command']) . " " . $log_target;
241241
} else {
242242
if(strpos($job['command'], "\n") !== false || strpos($job['command'], "\r") !== false || strpos($job['command'], chr(0)) !== false) {
243243
$app->log("Insecure Cron job SKIPPED: " . $job['command'], LOGLEVEL_WARN);
@@ -257,16 +257,16 @@ function _write_crontab() {
257257
$web_root .= '/web';
258258
$job['command'] = str_replace('[web_root]', $web_root, $job['command']);
259259

260-
$command .= "\t";
261-
//if($job['type'] != 'chrooted' && substr($job['command'], 0, 1) != "/") $command .= $this->parent_domain['document_root'].'/';
262-
$command .= $job['command'] . " " . $log_target;
260+
$cron_line .= "\t";
261+
//if($job['type'] != 'chrooted' && substr($job['command'], 0, 1) != "/") $cron_line .= $this->parent_domain['document_root'].'/';
262+
$cron_line .= $job['command'] . " " . $log_target;
263263
}
264264

265265
if($job['type'] == 'chrooted') {
266-
$chr_cron_content .= $command . " #{$job['domain']}\n";
266+
$chr_cron_content .= $cron_line . " #{$job['domain']}\n";
267267
$chr_cmd_count++;
268268
} else {
269-
$cron_content .= $command . " #{$job['domain']}\n";
269+
$cron_content .= $cron_line . " #{$job['domain']}\n";
270270
$cmd_count++;
271271
}
272272
}

0 commit comments

Comments
 (0)