Skip to content

Commit 3fd6591

Browse files
committed
Fixed: FS#1717 - Regular Expression (@reboot) in User Cron
1 parent 023e4b4 commit 3fd6591

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

interface/lib/classes/validate_cron.inc.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ function command_format($field_name, $field_value, $validator) {
5555
if(preg_match("'^([a-z0-9][a-z0-9-]{0,62}\.)+([a-z]{2,30})$'i", $parsed["host"]) == false) return $this->get_error($validator['errmsg']);
5656
}
5757
}
58+
59+
function run_month_format($field_name, $field_value, $validator) {
60+
global $app;
61+
//* allow value @reboot in month field
62+
if($field_value != '@reboot') {
63+
return $this->run_time_format($field_name, $field_value, $validator);
64+
}
65+
}
5866

5967
/*
6068
Validator function to check if a given cron time is in correct form.

interface/web/sites/form/cron.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
'formtype' => 'TEXT',
130130
'validators' => array ( 0 => array ( 'type' => 'CUSTOM',
131131
'class' => 'validate_cron',
132-
'function' => 'run_time_format',
132+
'function' => 'run_month_format',
133133
'errmsg'=> 'run_month_error_format'),
134134
),
135135
'default' => '',

0 commit comments

Comments
 (0)