Skip to content

Commit 902efa7

Browse files
committed
fix(targetticket,targetchange,targetproblem): missing translation of target content
1 parent ccdaee6 commit 902efa7

3 files changed

+6
-3
lines changed

inc/targetchange.class.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
use GlpiPlugin\Formcreator\Exception\ImportFailureException;
3333
use GlpiPlugin\Formcreator\Exception\ExportFailureException;
3434
use Glpi\Application\View\TemplateRenderer;
35+
use Glpi\Toolbox\Sanitizer;
3536

3637
if (!defined('GLPI_ROOT')) {
3738
die("Sorry. You can't access this file directly");
@@ -666,7 +667,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM {
666667
];
667668
foreach ($changeFields as $changeField) {
668669
$data[$changeField] = $this->prepareTemplate(
669-
$this->fields[$changeField] ?? '',
670+
Sanitizer::unsanitize(__($this->fields[$changeField], $domain)) ?? '',
670671
$formanswer,
671672
$changeField == 'content' // only content supports rich text
672673
);

inc/targetproblem.class.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
use GlpiPlugin\Formcreator\Exception\ImportFailureException;
3333
use GlpiPlugin\Formcreator\Exception\ExportFailureException;
3434
use Glpi\Application\View\TemplateRenderer;
35+
use Glpi\Toolbox\Sanitizer;
3536

3637
if (!defined('GLPI_ROOT')) {
3738
die("Sorry. You can't access this file directly");
@@ -185,7 +186,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM {
185186
];
186187
foreach ($problemFields as $problemFields) {
187188
$data[$problemFields] = $this->prepareTemplate(
188-
$this->fields[$problemFields] ?? '',
189+
Sanitizer::unsanitize(__($this->fields[$problemFields], $domain)) ?? '',
189190
$formanswer,
190191
$problemFields == 'content' // only content supports rich text
191192
);

inc/targetticket.class.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
use GlpiPlugin\Formcreator\Exception\ImportFailureException;
3333
use GlpiPlugin\Formcreator\Exception\ExportFailureException;
3434
use Glpi\Application\View\TemplateRenderer;
35+
use Glpi\Toolbox\Sanitizer;
3536

3637
if (!defined('GLPI_ROOT')) {
3738
die("Sorry. You can't access this file directly");
@@ -824,7 +825,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer): ?CommonDBTM {
824825
$data['date'] = $_SESSION['glpi_currenttime'];
825826

826827
$data['content'] = $this->prepareTemplate(
827-
$this->fields['content'] ?? '',
828+
Sanitizer::unsanitize(__($this->fields['content'], $domain)) ?? '',
828829
$formanswer,
829830
$richText
830831
);

0 commit comments

Comments
 (0)