Skip to content
Snippets Groups Projects
Commit 3fd6591a authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#1717 - Regular Expression (@reboot) in User Cron

parent 023e4b4f
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,14 @@ class validate_cron { ...@@ -55,6 +55,14 @@ class validate_cron {
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']); 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']);
} }
} }
function run_month_format($field_name, $field_value, $validator) {
global $app;
//* allow value @reboot in month field
if($field_value != '@reboot') {
return $this->run_time_format($field_name, $field_value, $validator);
}
}
/* /*
Validator function to check if a given cron time is in correct form. Validator function to check if a given cron time is in correct form.
......
...@@ -129,7 +129,7 @@ $form["tabs"]['cron'] = array ( ...@@ -129,7 +129,7 @@ $form["tabs"]['cron'] = array (
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'CUSTOM', 'validators' => array ( 0 => array ( 'type' => 'CUSTOM',
'class' => 'validate_cron', 'class' => 'validate_cron',
'function' => 'run_time_format', 'function' => 'run_month_format',
'errmsg'=> 'run_month_error_format'), 'errmsg'=> 'run_month_error_format'),
), ),
'default' => '', 'default' => '',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment