| @@ -13,8 +13,9 @@ | ||
| 13 | 13 | use Exception; |
| 14 | 14 | use LearnPress\Ajax\AbstractAjax; |
| 15 | 15 | |
| 16 | 16 | use LearnPress\Databases\QuestionAnswersDB; |
| 17 | +use LearnPress\Helpers\Template; | |
| 17 | 18 | use LearnPress\Models\Question\QuestionAnswerModel; |
| 18 | 19 | use LearnPress\Models\Question\QuestionPostFIBModel; |
| 19 | 20 | use LearnPress\Models\Question\QuestionPostModel; |
| 20 | 21 | use LearnPress\Models\Question\QuestionPostMultipleChoiceModel; |
| @@ -144,9 +145,9 @@ | ||
| 144 | 145 | $response = new LP_REST_Response(); |
| 145 | 146 | |
| 146 | 147 | try { |
| 147 | 148 | $data = self::check_valid(); |
| 148 | - $answer_title = $data['answer_title'] ?? ''; | |
| 149 | + $answer_title = Template::sanitize_html_content( $data['answer_title'] ?? '' ); | |
| 149 | 150 | if ( empty( $answer_title ) ) { |
| 150 | 151 | throw new Exception( __( 'Answer title is required', 'learnpress' ) ); |
| 151 | 152 | } |
| 152 | 153 | |