@@ -117,7 +117,7 @@ public function showForm($options=[]) {
117117 echo '<td><strong> ' . __ ('Description ' ) . ' <span style="color:red;">*</span></strong></td> ' ;
118118 echo '<td colspan="3"> ' ;
119119 echo '<textarea name="comment" style="width:700px;" rows="15"> ' . $ this ->fields ['comment ' ] . '</textarea> ' ;
120- if ($ CFG_GLPI ["use_rich_text " ]) {
120+ if (version_compare (PluginFormcreatorCommon:: getGlpiVersion (), 9.4 ) >= 0 || $ CFG_GLPI ["use_rich_text " ]) {
121121 Html::initEditorSystem ('comment ' );
122122 }
123123 echo '</td> ' ;
@@ -850,7 +850,7 @@ public function prepareInputForUpdate($input) {
850850 return [];
851851 }
852852
853- if ($ CFG_GLPI ['use_rich_text ' ]) {
853+ if (version_compare (PluginFormcreatorCommon:: getGlpiVersion (), 9.4 ) >= 0 || $ CFG_GLPI ['use_rich_text ' ]) {
854854 $ input ['comment ' ] = Html::entity_decode_deep ($ input ['comment ' ]);
855855 }
856856
@@ -1114,13 +1114,13 @@ public function save(PluginFormcreatorForm_Answer $formanswer) {
11141114 if (strpos ($ data ['content ' ], '##FULLFORM## ' ) !== false ) {
11151115 $ data ['content ' ] = str_replace ('##FULLFORM## ' , $ formanswer ->getFullForm (), $ data ['content ' ]);
11161116 }
1117- if ($ CFG_GLPI ['use_rich_text ' ]) {
1117+ if (version_compare (PluginFormcreatorCommon:: getGlpiVersion (), 9.4 ) >= 0 || $ CFG_GLPI ['use_rich_text ' ]) {
11181118 // replace HTML P tags with DIV tags
11191119 $ data ['content ' ] = str_replace (['<p> ' , '</p> ' ], ['<div> ' , '</div> ' ], $ data ['content ' ]);
11201120 }
11211121
11221122 $ data ['content ' ] = $ this ->parseTags ($ data ['content ' ], $ formanswer );
1123- if ($ CFG_GLPI ['use_rich_text ' ]) {
1123+ if (version_compare (PluginFormcreatorCommon:: getGlpiVersion (), 9.4 ) >= 0 || $ CFG_GLPI ['use_rich_text ' ]) {
11241124 $ data ['content ' ] = htmlentities ($ data ['content ' ]);
11251125 }
11261126 $ data ['_users_id_recipient ' ] = $ _SESSION ['glpiID ' ];
0 commit comments