fix(core): check cron expression on save

This commit is contained in:
Andras Bacsai
2025-01-28 11:01:50 +01:00
parent 497a7ac15a
commit 8f1bde2534

View File

@@ -79,6 +79,7 @@ class Show extends Component
$this->validate(); $this->validate();
$isValid = validate_cron_expression($this->frequency); $isValid = validate_cron_expression($this->frequency);
if (! $isValid) { if (! $isValid) {
$this->frequency = $this->task->frequency;
throw new \Exception('Invalid Cron / Human expression.'); throw new \Exception('Invalid Cron / Human expression.');
} }
$this->task->enabled = $this->isEnabled; $this->task->enabled = $this->isEnabled;