Skip to content

Commit

Permalink
fix(formanswer): use same HTML escaping as GLPI 10 does
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Feb 16, 2022
1 parent 63eac85 commit 35f9b6e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inc/formanswer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* ---------------------------------------------------------------------
*/

use Glpi\Toolbox\Sanitizer;
use GlpiPlugin\Formcreator\Field\DropdownField;

if (!defined('GLPI_ROOT')) {
Expand Down Expand Up @@ -1193,6 +1194,12 @@ public function parseTags(string $content, PluginFormcreatorTargetInterface $tar
}
}

if ($richText) {
// convert sanitization from old style GLPI ( up to 9.5 to modern style)
$content = Sanitizer::unsanitize($content);
$content = Sanitizer::sanitize($content);
}

return $content;
}

Expand Down

0 comments on commit 35f9b6e

Please sign in to comment.