From 9a15fbc71e296d7810984455aa7dc19503f89de3 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 18 Dec 2018 13:48:46 +0100 Subject: worklog: Fix hours validation closes #527 (Worklog entries with floating point numbers with a comma dispatches a team of untrained monkeys) --- includes/controller/user_worklog_controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/controller/user_worklog_controller.php b/includes/controller/user_worklog_controller.php index bf0eb1cf..7cedea92 100644 --- a/includes/controller/user_worklog_controller.php +++ b/includes/controller/user_worklog_controller.php @@ -82,7 +82,7 @@ function user_worklog_from_request($userWorkLog) } $userWorkLog['work_hours'] = $request->input('work_hours'); - if (!preg_match("/[0-9]+(\.[0-9]+)?/", $userWorkLog['work_hours'])) { + if (!preg_match("/^[0-9]+(\.[0-9]+)?$/", $userWorkLog['work_hours'])) { $valid = false; error(__('Please enter work hours in format ##[.##].')); } -- cgit v1.2.3-70-g09d2