Fixed potential XSS injection vectors in datatables columns

This commit is contained in:
Jan Böhmer 2023-02-26 01:23:36 +01:00
parent 5f39d8e594
commit 83cd91f1d1
6 changed files with 10 additions and 10 deletions

View file

@ -84,7 +84,7 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
return round($context->getQuantity());
}
//Otherwise use the unit of the part to format the quantity
return $this->amountFormatter->format($context->getQuantity(), $context->getPart()->getPartUnit());
return htmlspecialchars($this->amountFormatter->format($context->getQuantity(), $context->getPart()->getPartUnit()));
},
])
@ -93,7 +93,7 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
'orderable' => false,
'render' => function ($value, ProjectBOMEntry $context) {
if($context->getPart() === null) {
return $context->getName();
return htmlspecialchars($context->getName());
}
if($context->getPart() !== null) {
$tmp = $this->partDataTableHelper->renderName($context->getPart());