From 713a9a3ee1c34824c52173a0b1840fceb7ab5b61 Mon Sep 17 00:00:00 2001 From: Vinciane <vinciane.bizet@maarch.org> Date: Fri, 4 Jan 2019 17:44:32 +0100 Subject: [PATCH] TU Change control function create --- .../controllers/NotificationScheduleController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/notification/controllers/NotificationScheduleController.php b/src/app/notification/controllers/NotificationScheduleController.php index 69189e0d396..fc3c40c8239 100755 --- a/src/app/notification/controllers/NotificationScheduleController.php +++ b/src/app/notification/controllers/NotificationScheduleController.php @@ -53,7 +53,8 @@ class NotificationScheduleController if (($key == 'cmd' || $key == 'state') && !Validator::notEmpty()->validate($value)) { $errors[] = $key.' is empty'; } - if ($key != 'cmd' && $key != 'state' && $key != 'description' && !Validator::intVal()->validate($value) && $value != '*') { + + if ($key != 'cmd' && $key != 'state' && $key != 'description' && !preg_match('#^[0-9\/*][0-9]?[,\/-]?([0-9]?){2}#', $value) ) { $errors[] = 'wrong format for '.$key; } } -- GitLab