N°3581 - Dashlet plain text: Fix line returns while keeping XSS protection

This commit is contained in:
Molkobain
2021-03-18 20:22:55 +01:00
parent b3e3a27555
commit f567f581c3
2 changed files with 5 additions and 1 deletions

View File

@@ -849,6 +849,7 @@ class DashletPlainText extends Dashlet
public function Render($oPage, $bEditMode = false, $aExtraParams = array())
{
$sText = $this->aProperties['text'];
$sText = utils::EscapeHtml($sText);
$sText = str_replace(array("\r\n", "\n", "\r"), "<br/>", $sText);
$sId = 'plaintext_'.($bEditMode ? 'edit_' : '').$this->sId;