diff --git a/inc/targetchange.class.php b/inc/targetchange.class.php index a4d1efd01..a7b7f8a4a 100644 --- a/inc/targetchange.class.php +++ b/inc/targetchange.class.php @@ -32,6 +32,7 @@ use GlpiPlugin\Formcreator\Exception\ImportFailureException; use GlpiPlugin\Formcreator\Exception\ExportFailureException; use Glpi\Application\View\TemplateRenderer; +use Glpi\Toolbox\Sanitizer; if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); @@ -666,7 +667,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM { ]; foreach ($changeFields as $changeField) { $data[$changeField] = $this->prepareTemplate( - $this->fields[$changeField] ?? '', + Sanitizer::unsanitize(__($this->fields[$changeField], $domain)) ?? '', $formanswer, $changeField == 'content' // only content supports rich text ); diff --git a/inc/targetproblem.class.php b/inc/targetproblem.class.php index b4d3326ec..42d372757 100644 --- a/inc/targetproblem.class.php +++ b/inc/targetproblem.class.php @@ -32,6 +32,7 @@ use GlpiPlugin\Formcreator\Exception\ImportFailureException; use GlpiPlugin\Formcreator\Exception\ExportFailureException; use Glpi\Application\View\TemplateRenderer; +use Glpi\Toolbox\Sanitizer; if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); @@ -185,7 +186,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM { ]; foreach ($problemFields as $problemFields) { $data[$problemFields] = $this->prepareTemplate( - $this->fields[$problemFields] ?? '', + Sanitizer::unsanitize(__($this->fields[$problemFields], $domain)) ?? '', $formanswer, $problemFields == 'content' // only content supports rich text ); diff --git a/inc/targetticket.class.php b/inc/targetticket.class.php index b819e51c7..1f821b2d9 100644 --- a/inc/targetticket.class.php +++ b/inc/targetticket.class.php @@ -32,6 +32,7 @@ use GlpiPlugin\Formcreator\Exception\ImportFailureException; use GlpiPlugin\Formcreator\Exception\ExportFailureException; use Glpi\Application\View\TemplateRenderer; +use Glpi\Toolbox\Sanitizer; if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); @@ -824,7 +825,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM { $data['date'] = $_SESSION['glpi_currenttime']; $data['content'] = $this->prepareTemplate( - $this->fields['content'] ?? '', + Sanitizer::unsanitize(__($this->fields['content'], $domain)) ?? '', $formanswer, $richText );