File tree Expand file tree Collapse file tree
SurveyQuestionPool/Questions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 *
1717 *********************************************************************/
1818
19+ use ILIAS \LegalDocuments \HTMLPurifier ;
1920use ILIAS \Survey \Editing \EditManager ;
2021use ILIAS \Survey \Editing \EditingGUIRequest ;
2122
@@ -1107,14 +1108,13 @@ public function saveHeadingObject(): void
11071108
11081109 $ form = $ this ->initHeadingForm ($ q_id );
11091110 if ($ form ->checkInput ()) {
1110- $ this ->object ->saveHeading (
1111- ilUtil::stripSlashes (
1112- $ form ->getInput ("heading " ),
1113- true ,
1114- ilObjAdvancedEditing::_getUsedHTMLTagsAsString ("survey " )
1115- ),
1116- $ form ->getInput ("insertbefore " )
1117- );
1111+ $ tags = ilObjAdvancedEditing::_getUsedHTMLTags ("survey " );
1112+ $ purifier = new HTMLPurifier ($ tags );
1113+ $ heading = $ form ->getInput ("heading " );
1114+
1115+ $ heading = $ purifier ->purify ($ heading );
1116+
1117+ $ this ->object ->saveHeading ($ heading , $ form ->getInput ("insertbefore " ));
11181118 $ this ->ctrl ->redirect ($ this , "questions " );
11191119 }
11201120
Original file line number Diff line number Diff line change 2020
2121namespace ILIAS \Survey \Settings ;
2222
23+ use ILIAS \LegalDocuments \HTMLPurifier ;
2324use ILIAS \Survey \InternalGUIService ;
2425use ILIAS \Survey \Mode \UIModifier ;
2526use ILIAS \Survey \InternalDomainService ;
27+ use ilObjAdvancedEditing ;
2628
2729/**
2830 * Settings form
@@ -893,8 +895,16 @@ public function saveForm(
893895 } else {
894896 $ survey ->setEndDate ("" );
895897 }
896- $ survey ->setIntroduction ($ form ->getInput ("introduction " ));
897- $ survey ->setOutro ($ form ->getInput ("outro " ));
898+
899+ $ tags = ilObjAdvancedEditing::_getUsedHTMLTags ("survey " );
900+ $ purifier = new HTMLPurifier ($ tags );
901+
902+ $ introduction = $ form ->getInput ("introduction " );
903+ $ introduction = $ purifier ->purify ($ introduction );
904+ $ survey ->setIntroduction ($ introduction );
905+ $ outro = $ form ->getInput ("outro " );
906+ $ outro = $ purifier ->purify ($ outro );
907+ $ survey ->setOutro ($ outro );
898908 $ survey ->setShowQuestionTitles ((bool ) $ form ->getInput ("show_question_titles " ));
899909 $ survey ->setPoolUsage ((bool ) $ form ->getInput ("use_pool " ));
900910
Original file line number Diff line number Diff line change 1616 *
1717 *********************************************************************/
1818
19+ use ILIAS \LegalDocuments \HTMLPurifier ;
1920use ILIAS \SurveyQuestionPool \Editing \EditingGUIRequest ;
2021use ILIAS \SurveyQuestionPool \Editing \EditManager ;
2122
@@ -332,7 +333,14 @@ protected function saveForm(): bool
332333 $ this ->object ->label = ($ form ->getInput ("label " ));
333334 $ this ->object ->setAuthor ($ form ->getInput ("author " ));
334335 $ this ->object ->setDescription ($ form ->getInput ("description " ));
335- $ this ->object ->setQuestiontext ($ form ->getInput ("question " ));
336+
337+ $ tags = ilObjAdvancedEditing::_getUsedHTMLTags ("survey " );
338+ $ purifier = new HTMLPurifier ($ tags );
339+ $ question = $ form ->getInput ("question " );
340+
341+ $ question = $ purifier ->purify ($ question );
342+
343+ $ this ->object ->setQuestiontext ($ question );
336344 $ this ->object ->setObligatory ($ form ->getInput ("obligatory " ));
337345
338346 $ this ->importEditFormValues ($ form );
You can’t perform that action at this time.
0 commit comments