diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php
index dc2a4b5d9..93f07434b 100644
--- a/php/classes/class-qmn-quiz-manager.php
+++ b/php/classes/class-qmn-quiz-manager.php
@@ -1286,7 +1286,7 @@ public function display_pages( $options, $quiz_data ) {
run_shortcode( $message_before );
$editor_text = preg_replace( '/\s*[\w\/:\.]*youtube.com\/watch\?v=([\w]+)([\w\*\-\?\&\;\%\=\.]*)/i', '', $editor_text );
- echo do_shortcode( wp_kses_post( $editor_text ) );
+ echo wp_kses_post( do_shortcode( $editor_text ) );
?>
run_shortcode( $message_before );
$editor_text = preg_replace( '/\s*[\w\/:\.]*youtube.com\/watch\?v=([\w]+)([\w\*\-\?\&\;\%\=\.]*)/i', '', $editor_text );
- echo do_shortcode( wp_kses_post( $editor_text ) );
+ echo wp_kses_post( do_shortcode( $editor_text ) );
?>
pluginHelper->qsm_language_support( htmlspecialchars_decode( $qmn_quiz_options->message_comment, ENT_QUOTES ), "quiz_message_comment-{$qmn_quiz_options->quiz_id}" );
$message_comments = apply_filters( 'mlw_qmn_template_variable_quiz_page', wpautop( $message_comments ), $qmn_array_for_variables );
?>
-
+
pluginHelper->qsm_language_support( htmlspecialchars_decode( $qmn_quiz_options->message_end_template, ENT_QUOTES ), "quiz_message_end_template-{$qmn_quiz_options->quiz_id}" );
$message_end = apply_filters( 'mlw_qmn_template_variable_quiz_page', wpautop( $message_end ), $qmn_array_for_variables );
- echo do_shortcode( wp_kses_post( $message_end ) );
+ echo wp_kses_post( do_shortcode( $message_end ) );
?>
diff --git a/php/classes/class-qsm-results-pages.php b/php/classes/class-qsm-results-pages.php
index c7a4aea0d..5b334b85d 100644
--- a/php/classes/class-qsm-results-pages.php
+++ b/php/classes/class-qsm-results-pages.php
@@ -177,12 +177,12 @@ public static function generate_pages( $response_data ) {
// Decodes special characters, runs through our template
// variables, and then outputs the text.
- $page = wp_kses_post( htmlspecialchars_decode( $content, ENT_QUOTES) );
+ $page = htmlspecialchars_decode( $content, ENT_QUOTES);
//last chance to filter $page
$page = apply_filters( 'qsm_template_variable_results_page', $page, $response_data );
- echo apply_filters( 'mlw_qmn_template_variable_results_page', $page, $response_data );
+ echo wp_kses_post( apply_filters( 'mlw_qmn_template_variable_results_page', $page, $response_data ) );
do_action( 'qsm_after_results_page', $response_data, $page_index );
?>
pluginHelper->qsm_language_support( $answer_text, 'answer-' . $id . '-' . $answer_index, 'QSM Answers' );
- echo do_shortcode( wp_kses_post( $answer_text ) );
+ echo wp_kses_post( do_shortcode( $answer_text ) );
}
?>
diff --git a/php/question-types/qsm-question-type-multiple-choice.php b/php/question-types/qsm-question-type-multiple-choice.php
index ea9b2daf1..aad38dd6c 100644
--- a/php/question-types/qsm-question-type-multiple-choice.php
+++ b/php/question-types/qsm-question-type-multiple-choice.php
@@ -85,7 +85,7 @@ function qmn_multiple_choice_display( $id, $question, $answers ) {
} else {
$answer_text = trim( htmlspecialchars_decode($add_label_value." ".$answer[0], ENT_QUOTES ) );
$answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, 'answer-' . $id . '-' . $answer_index, 'QSM Answers' );
- echo do_shortcode( wp_kses_post($answer_text ) );
+ echo wp_kses_post( do_shortcode($answer_text ) );
}
?>
diff --git a/php/question-types/qsm-question-type-multiple-response-horizontal.php b/php/question-types/qsm-question-type-multiple-response-horizontal.php
index 46af519b6..c244a6ec4 100644
--- a/php/question-types/qsm-question-type-multiple-response-horizontal.php
+++ b/php/question-types/qsm-question-type-multiple-response-horizontal.php
@@ -73,7 +73,7 @@ function qmn_horizontal_multiple_response_display( $id, $question, $answers ) {
} else {
$answer_text = trim( htmlspecialchars_decode( $add_label_value." ".$answer[0], ENT_QUOTES ) );
$answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, 'answer-' . $answer_text, 'QSM Answers' );
- echo do_shortcode( wp_kses_post( $answer_text ) );
+ echo wp_kses_post( do_shortcode( $answer_text ) );
}
?>
diff --git a/php/question-types/qsm-question-type-multiple-response.php b/php/question-types/qsm-question-type-multiple-response.php
index 9fabace86..0484de9c0 100644
--- a/php/question-types/qsm-question-type-multiple-response.php
+++ b/php/question-types/qsm-question-type-multiple-response.php
@@ -74,7 +74,7 @@ function qmn_multiple_response_display( $id, $question, $answers ) {
} else {
$answer_text = trim( htmlspecialchars_decode( $add_label_value." ". $answer[0], ENT_QUOTES ) );
$answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, 'answer-' . $id . '-' . $answer_index, 'QSM Answers' );
- echo do_shortcode( wp_kses_post( $answer_text ) );
+ echo wp_kses_post( do_shortcode( $answer_text ) );
}
?>
diff --git a/php/question-types/qsm-question-type-opt-in.php b/php/question-types/qsm-question-type-opt-in.php
index 4758e712e..4d4c9adb6 100644
--- a/php/question-types/qsm-question-type-opt-in.php
+++ b/php/question-types/qsm-question-type-opt-in.php
@@ -30,7 +30,7 @@ function qmn_accept_display( $id, $question, $answers ) {
$question = $mlwQuizMasterNext->pluginHelper->get_question_setting( $id, 'question_title' );
}
$question = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( $question, ENT_QUOTES ), "question-description-{$id}", 'QSM Questions' );
- echo do_shortcode( wp_kses_post( $question ) );
+ echo wp_kses_post( do_shortcode( $question ) );
?>
diff --git a/php/question-types/qsm-question-type-polar.php b/php/question-types/qsm-question-type-polar.php
index 2d562ca16..6464eff20 100644
--- a/php/question-types/qsm-question-type-polar.php
+++ b/php/question-types/qsm-question-type-polar.php
@@ -66,7 +66,7 @@ function qmn_polar_display( $id, $question, $answers ) {
pluginHelper->qsm_language_support( $answers[0][0], 'answer-' . $id . '-0', "QSM Answers" );
- echo do_shortcode( wp_kses_post( $left_title ) );
+ echo wp_kses_post( do_shortcode( $left_title ) );
}
?>
@@ -95,7 +95,7 @@ function qmn_polar_display( $id, $question, $answers ) {
pluginHelper->qsm_language_support( $answers[1][0], 'answer-' . $id . '-1', "QSM Answers" );
- echo do_shortcode( wp_kses_post( $right_title ) );
+ echo wp_kses_post( do_shortcode( $right_title ) );
}
?>
diff --git a/php/shortcodes.php b/php/shortcodes.php
index 9c506114d..35774c980 100644
--- a/php/shortcodes.php
+++ b/php/shortcodes.php
@@ -85,7 +85,7 @@ function qsm_display_recent_quizzes( $attrs ) {
} elseif ( $start_date && $start_date > $now && 'no' === $include_future_quizzes ) {
continue;
} else {
- $title = $quiz->quiz_name;
+ $title = esc_html( $quiz->quiz_name );
$id = $quiz->quiz_id;
$url = do_shortcode( "[qsm_link id='$id'] Take Quiz [/qsm_link]" );
$result .= "
diff --git a/php/template-variables.php b/php/template-variables.php
index f450c09d4..551d81599 100644
--- a/php/template-variables.php
+++ b/php/template-variables.php
@@ -1392,7 +1392,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
$question_max_point = ( isset( $questions[ $answer['id'] ] ) ? qsm_get_question_maximum_points( $questions[ $answer['id'] ] ) : 0 );
$mlw_question_answer_display = str_replace( '%QUESTION_MAX_POINTS%', $question_max_point, $mlw_question_answer_display );
- $mlw_question_answer_display = do_shortcode( wp_kses_post( $mlw_question_answer_display ) );
+ $mlw_question_answer_display = wp_kses_post( do_shortcode( $mlw_question_answer_display ) );
if ( $total_question_cnt == $qsm_question_cnt && false == $remove_border ) {
$extra_border_bottom_class = 'qsm-remove-border-bottom';
@@ -1401,7 +1401,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question
$question_obj = ( isset( $questions[ $answer['id'] ] ) ? $questions[ $answer['id'] ] : null );
$display = "';
- return $display;
+ return wp_kses_post( $display );
}
function qsm_get_question_maximum_points( $question = array() ) {
@@ -1530,7 +1530,7 @@ function qmn_polar_display_on_resultspage( $id, $question, $answers, $answer ) {
$input_text .= ''.esc_html( $caption_text ).'';
} else {
$left_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answers[0][0], "answer-" . $answers[0][0], "QSM Answers" );
- $input_text .= do_shortcode( wp_kses_post( $left_title ) );
+ $input_text .= wp_kses_post( do_shortcode( $left_title ) );
}
$input_text .= "
";
@@ -1552,7 +1552,7 @@ function qmn_polar_display_on_resultspage( $id, $question, $answers, $answer ) {
$input_text .= ''.esc_html( $caption_text ).'';
} else {
$right_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answers[1][0], "answer-" . $answers[0][0], "QSM Answers" );
- $input_text .= do_shortcode( wp_kses_post( $right_title ) );
+ $input_text .= wp_kses_post( do_shortcode( $right_title ) );
}
$input_text .= "";
$question = $input_text;
@@ -1623,10 +1623,10 @@ function qsm_varibale_question_title_func( $question, $question_type = '', $new_
if ( '' !== $new_question_title ) {
$new_question_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( $new_question_title, ENT_QUOTES ), "Question-{$question_id}", 'QSM Questions' );
- $question_display .= "" . $new_question_title . '
';
+ $question_display .= "" . esc_html( $new_question_title ) . '
';
$polar_extra_class .= ' qsm_remove_bold';
}
$question_display .= "" . do_shortcode( $question_title ) . '
';
- return $question_display;
+ return wp_kses_post( $question_display );
}