Skip to content

Commit f739c54

Browse files
authored
fix: rich description encoding in ticket (#775)
GLPI saves rich text as html-entities-ized content i.e <p> tag is saved as &lt;p&gt; Formcreator shall do the same even if it seems to not have impact anywhere
1 parent 9aaa87f commit f739c54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inc/targetticket.class.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ public function pre_deleteItem() {
981981
* @return Ticket|null Generated ticket if success, null otherwise
982982
*/
983983
public function save(PluginFormcreatorForm_Answer $formanswer) {
984-
global $DB;
984+
global $DB, $CFG_GLPI;
985985

986986
// Prepare actors structures for creation of the ticket
987987
$this->requesters = [
@@ -1084,7 +1084,9 @@ public function save(PluginFormcreatorForm_Answer $formanswer) {
10841084
$data['content'] = str_replace('##FULLFORM##', $formanswer->getFullForm(), $data['content']);
10851085
}
10861086
$data['content'] = addslashes($this->parseTags($data['content'], $formanswer));
1087-
1087+
if ($CFG_GLPI['use_rich_text']) {
1088+
$data['content'] = htmlentities($data['content']);
1089+
}
10881090
$data['_users_id_recipient'] = $_SESSION['glpiID'];
10891091
$data['_tickettemplates_id'] = $this->fields['tickettemplates_id'];
10901092

0 commit comments

Comments
 (0)