From 5baf07c8984abf55d3207b7c75a6ea03bfcb103f Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Thu, 27 Sep 2018 08:32:39 -0400 Subject: [PATCH] Simplify schedule validation (cherry picked from commit bb7cabdb20e7bad06263d5b3888c71415d6861c1) --- src/usr/local/www/services_acb_settings.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/usr/local/www/services_acb_settings.php b/src/usr/local/www/services_acb_settings.php index 6f151da9b9..ce610bd5ed 100644 --- a/src/usr/local/www/services_acb_settings.php +++ b/src/usr/local/www/services_acb_settings.php @@ -88,20 +88,8 @@ if (isset($_POST['save'])) { } if ($_POST['frequency'] === 'cron') { - if(!preg_match('/^[0-9\*\/]+$/', $_POST['hours'])) { - $input_errors[] = gettext("Schedule hours may only contain numbers '*' or '/'"); - } - - if(!preg_match('/^[0-9\*\/]+$/', $_POST['day'])) { - $input_errors[] = gettext("Schedule days may only contain numbers '*' or '/'"); - } - - if(!preg_match('/^[0-9\*\/]+$/', $_POST['month'])) { - $input_errors[] = gettext("Schedule month may only contain numbers '*' or '/'"); - } - - if(!preg_match('/^[0-9\*\/]+$/', $_POST['dow'])) { - $input_errors[] = gettext("Schedule day of week may only contain numbers '*' or '/'"); + if (!preg_match('/^[0-9\*\/\-\,]+$/', $_POST['hours'] . $_POST['day'] . $_POST['month'] . $_POST['dow'])) { + $input_errors[] = gettext("Schedule values may only contain 0-9 - , / *"); } }