Skip to content

Commit

Permalink
fix(targetticket,targetchange,targetproblem): missing translation of …
Browse files Browse the repository at this point in the history
…target content
  • Loading branch information
btry committed Mar 31, 2023
1 parent ccdaee6 commit 902efa7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion inc/targetchange.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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
);
Expand Down
3 changes: 2 additions & 1 deletion inc/targetproblem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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
);
Expand Down
3 changes: 2 additions & 1 deletion inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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
);
Expand Down

0 comments on commit 902efa7

Please sign in to comment.