summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-12-18 13:48:46 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2018-12-18 13:48:46 +0100
commit9a15fbc71e296d7810984455aa7dc19503f89de3 (patch)
tree0f8c2237a80aae37ef7cf40437cd68d49398cf72
parent204ff4c0e79fab0d1f73daa29a026582efffee69 (diff)
worklog: Fix hours validation
closes #527 (Worklog entries with floating point numbers with a comma dispatches a team of untrained monkeys)
-rw-r--r--includes/controller/user_worklog_controller.php2
1 files changed, 1 insertions, 1 deletions
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 ##[.##].'));
}