From 94753bc3d866071980148a2fd9e1bd5fa72b7a13 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Thu, 9 Jan 2020 13:43:10 +0100 Subject: Worklog: Limit worklog comment length to 200 as it is configured in the database --- includes/controller/user_worklog_controller.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'includes/controller/user_worklog_controller.php') diff --git a/includes/controller/user_worklog_controller.php b/includes/controller/user_worklog_controller.php index 6b100338..5bb07f33 100644 --- a/includes/controller/user_worklog_controller.php +++ b/includes/controller/user_worklog_controller.php @@ -93,6 +93,11 @@ function user_worklog_from_request($userWorkLog) error(__('Please enter a comment.')); } + if (mb_strlen($userWorkLog['comment']) > 200) { + $valid = false; + error(__('Comment too long.')); + } + return [ $valid, $userWorkLog -- cgit v1.2.3-54-g00ecf