From 3ee69996823d94d7cc3c427ad83837fd81ffd13a Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 30 Oct 2025 10:07:57 +0100 Subject: [PATCH] fix: Use substr to cut error messages This allows for cutting them to longer lengths Signed-off-by: Marcel Klehr --- lib/private/TaskProcessing/Manager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 4bdf57878d1..395b79d1a8c 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -1101,11 +1101,11 @@ class Manager implements IManager { if ($error !== null) { $task->setStatus(Task::STATUS_FAILED); $task->setEndedAt(time()); - // truncate error message to 1000 characters - $task->setErrorMessage(mb_substr($error, 0, 1000)); - // truncate error message to 1000 characters + // truncate error message to 4000 characters + $task->setErrorMessage(substr($error, 0, 4000)); + // truncate error message to 4000 characters if ($userFacingError !== null) { - $task->setUserFacingErrorMessage(mb_substr($userFacingError, 0, 1000)); + $task->setUserFacingErrorMessage(substr($userFacingError, 0, 4000)); } $this->logger->warning('A TaskProcessing ' . $task->getTaskTypeId() . ' task with id ' . $id . ' failed with the following message: ' . $error); } elseif ($result !== null) {