diff --git a/inc/form_answer.class.php b/inc/form_answer.class.php index d878fdc2d..bdba655c7 100644 --- a/inc/form_answer.class.php +++ b/inc/form_answer.class.php @@ -1081,7 +1081,7 @@ public function getFullForm() { $output = ''; $eol = '\r\n'; - if ($CFG_GLPI['use_rich_text']) { + if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), 9.4) >= 0 || $CFG_GLPI['use_rich_text']) { $output .= '

' . __('Form data', 'formcreator') . '

'; } else { $output .= __('Form data', 'formcreator') . $eol; @@ -1110,7 +1110,7 @@ public function getFullForm() { // Get and display current section if needed if ($last_section != $question_line['section_name']) { - if ($CFG_GLPI['use_rich_text']) { + if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), 9.4) >= 0 || $CFG_GLPI['use_rich_text']) { $output .= '

' . Toolbox::addslashes_deep($question_line['section_name']) . '

'; } else { $output .= $eol . Toolbox::addslashes_deep($question_line['section_name']) . $eol; @@ -1131,7 +1131,7 @@ public function getFullForm() { if ($question_line['fieldtype'] != 'description') { $question_no++; - if ($CFG_GLPI['use_rich_text']) { + if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), 9.4) >= 0 || $CFG_GLPI['use_rich_text']) { $output .= '
'; $output .= '' . $question_no . ') ##question_' . $question_line['id'] . '## : '; $output .= '##answer_' . $question_line['id'] . '##'; diff --git a/inc/targetticket.class.php b/inc/targetticket.class.php index 2e381cbe3..aca00c914 100644 --- a/inc/targetticket.class.php +++ b/inc/targetticket.class.php @@ -117,7 +117,7 @@ public function showForm($options=[]) { echo '' . __('Description') . ' *'; echo ''; echo ''; - if ($CFG_GLPI["use_rich_text"]) { + if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), 9.4) >= 0 || $CFG_GLPI["use_rich_text"]) { Html::initEditorSystem('comment'); } echo ''; @@ -850,7 +850,7 @@ public function prepareInputForUpdate($input) { return []; } - if ($CFG_GLPI['use_rich_text']) { + if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), 9.4) >= 0 || $CFG_GLPI['use_rich_text']) { $input['comment'] = Html::entity_decode_deep($input['comment']); } @@ -1114,13 +1114,13 @@ public function save(PluginFormcreatorForm_Answer $formanswer) { if (strpos($data['content'], '##FULLFORM##') !== false) { $data['content'] = str_replace('##FULLFORM##', $formanswer->getFullForm(), $data['content']); } - if ($CFG_GLPI['use_rich_text']) { + if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), 9.4) >= 0 || $CFG_GLPI['use_rich_text']) { // replace HTML P tags with DIV tags $data['content'] = str_replace(['

', '

'], ['
', '
'], $data['content']); } $data['content'] = $this->parseTags($data['content'], $formanswer); - if ($CFG_GLPI['use_rich_text']) { + if (version_compare(PluginFormcreatorCommon::getGlpiVersion(), 9.4) >= 0 || $CFG_GLPI['use_rich_text']) { $data['content'] = htmlentities($data['content']); } $data['_users_id_recipient'] = $_SESSION['glpiID'];