worklog: Fix hours validation

closes #527 (Worklog entries with floating point numbers with a comma dispatches a team of untrained monkeys)
This commit is contained in:
Igor Scheller 2018-12-18 13:48:46 +01:00
parent 204ff4c0e7
commit 9a15fbc71e
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ function user_worklog_from_request($userWorkLog)
} }
$userWorkLog['work_hours'] = $request->input('work_hours'); $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; $valid = false;
error(__('Please enter work hours in format ##[.##].')); error(__('Please enter work hours in format ##[.##].'));
} }