fix: Work around psalm taint false-positive by not using var_export

var_export is listed as a taint sink because it may output stuff
 depending on the parameters. It was not the case here, but we can
 simply json_encode the result by passing it as context to the logger
 method rather than using var_export.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/50800/head
Côme Chilliet 1 year ago
parent fec865cc29
commit 85fbd3eb0a
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 2
      lib/private/TaskProcessing/Manager.php

@ -999,7 +999,7 @@ class Manager implements IManager {
$task->setEndedAt(time());
$error = 'The task was processed successfully but the provider\'s output doesn\'t pass validation against the task type\'s outputShape spec and/or the provider\'s own optionalOutputShape spec';
$task->setErrorMessage($error);
$this->logger->error($error . ' Output was: ' . var_export($result, true), ['exception' => $e]);
$this->logger->error($error, ['exception' => $e, 'output' => $result]);
} catch (NotPermittedException $e) {
$task->setProgress(1);
$task->setStatus(Task::STATUS_FAILED);

Loading…
Cancel
Save