Skip to content
Prev Previous commit
Next Next commit
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 <[email protected]>
  • Loading branch information
come-nc committed Feb 17, 2025
commit 85fbd3eb0ab1650f9385acd869d5f4ab21006a8a
2 changes: 1 addition & 1 deletion lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ public function setTaskResult(int $id, ?string $error, ?array $result, bool $isU
$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);
Expand Down