Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Avoid XSS if row is not editable #845

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Datatable/Column/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ public function renderSingleField(array &$row)

if ($this->isEditableContentRequired($row)) {
$content = $this->renderTemplate($this->accessor->getValue($row, $path), $row[$this->editable->getPk()]);
$this->accessor->setValue($row, $path, $content);
}

else {
$content = htmlspecialchars($this->accessor->getValue($row, $path));
}
$this->accessor->setValue($row, $path, $content);
}

return $this;
Expand Down