From 0625783fcb7e34ada1fb07bebc61d155b7cfb848 Mon Sep 17 00:00:00 2001 From: Akshay Paghdar Date: Mon, 20 Jun 2022 16:28:53 +0530 Subject: [PATCH 1/7] Fixed content escaping issue. --- php/admin/functions.php | 10 +++++----- php/classes/class-qmn-quiz-manager.php | 2 +- php/question-types/qsm-question-title.php | 4 ++-- .../qsm-question-type-multiple-choice-horizontal.php | 2 +- .../qsm-question-type-multiple-choice.php | 2 +- .../qsm-question-type-multiple-response-horizontal.php | 2 +- .../qsm-question-type-multiple-response.php | 2 +- php/question-types/qsm-question-type-opt-in.php | 5 ++--- php/question-types/qsm-question-type-text-or-html.php | 5 ++--- php/template-variables.php | 4 ++-- 10 files changed, 18 insertions(+), 20 deletions(-) diff --git a/php/admin/functions.php b/php/admin/functions.php index 9cd19a39f..840e1fb52 100644 --- a/php/admin/functions.php +++ b/php/admin/functions.php @@ -998,7 +998,7 @@ function qsm_get_installed_theme( $saved_quiz_theme, $wizard_theme_list = '' ) { >
- +
@@ -1081,7 +1081,7 @@ function qsm_get_default_wizard_themes() {
- +
@@ -1089,7 +1089,7 @@ function qsm_get_default_wizard_themes() { href="?utm_source=plugin&utm_medium=wizard"> - +
@@ -1115,13 +1115,13 @@ function qsm_get_market_themes() {
- +
diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index 21ecd17e5..56fd0439c 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -1308,7 +1308,7 @@ public function display_comment_section( $qmn_quiz_options, $qmn_array_for_varia $message_comments = $mlwQuizMasterNext->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( $question_title, ENT_QUOTES ), "question-description-{$question_id}", "QSM Questions" ) ); + $question_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( $question_title, ENT_QUOTES ), "question-description-{$question_id}", "QSM Questions" ); } ?>
- +
pluginHelper->qsm_language_support( $answer_text, 'answer-' . $answer_text, 'QSM Answers' ); - echo wp_kses_post( do_shortcode( $answer_text ) ); + echo do_shortcode( wp_kses_post( $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 dc537f759..643f98381 100644 --- a/php/question-types/qsm-question-type-multiple-choice.php +++ b/php/question-types/qsm-question-type-multiple-choice.php @@ -65,7 +65,7 @@ function qmn_multiple_choice_display( $id, $question, $answers ) { } else { $answer_text = trim( htmlspecialchars_decode( $answer[0], ENT_QUOTES ) ); $answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, 'answer-' . $answer_text, 'QSM Answers' ); - echo wp_kses_post( do_shortcode( $answer_text ) ); + echo do_shortcode( wp_kses_post( $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 0b80ae919..3755544c9 100644 --- a/php/question-types/qsm-question-type-multiple-response-horizontal.php +++ b/php/question-types/qsm-question-type-multiple-response-horizontal.php @@ -54,7 +54,7 @@ function qmn_horizontal_multiple_response_display( $id, $question, $answers ) { } else { $answer_text = trim( htmlspecialchars_decode( $answer[0], ENT_QUOTES ) ); $answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, 'answer-' . $answer_text, 'QSM Answers' ); - echo wp_kses_post( do_shortcode( $answer_text ) ); + echo do_shortcode( wp_kses_post( $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 56cd4a263..6d9e5048e 100644 --- a/php/question-types/qsm-question-type-multiple-response.php +++ b/php/question-types/qsm-question-type-multiple-response.php @@ -57,7 +57,7 @@ function qmn_multiple_response_display( $id, $question, $answers ) { } else { $answer_text = trim( htmlspecialchars_decode( $answer[0], ENT_QUOTES ) ); $answer_text = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer_text, 'answer-' . $answer_text, 'QSM Answers' ); - echo wp_kses_post( do_shortcode( $answer_text ) ); + echo do_shortcode( wp_kses_post( $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 8b2eb96b5..a39c8a9c6 100644 --- a/php/question-types/qsm-question-type-opt-in.php +++ b/php/question-types/qsm-question-type-opt-in.php @@ -26,9 +26,8 @@ function qmn_accept_display( $id, $question, $answers ) { diff --git a/php/question-types/qsm-question-type-text-or-html.php b/php/question-types/qsm-question-type-text-or-html.php index 0e55bb2f4..eb3f60a4a 100644 --- a/php/question-types/qsm-question-type-text-or-html.php +++ b/php/question-types/qsm-question-type-text-or-html.php @@ -14,8 +14,7 @@ */ function qmn_text_block_display( $id, $question, $answers ) { global $mlwQuizMasterNext; - $question = do_shortcode( htmlspecialchars_decode( $question, ENT_QUOTES ) ); - $question = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $question, "question-description-{$id}", "QSM Questions" ); + $question = $mlwQuizMasterNext->pluginHelper->qsm_language_support( htmlspecialchars_decode( $question, ENT_QUOTES ), "question-description-{$id}", "QSM Questions" ); $question = apply_filters( 'qmn_text_block_display_front', $question, $id, $answers); - echo wp_kses_post( $question ); + echo do_shortcode( wp_kses_post( $question ) ); } \ No newline at end of file diff --git a/php/template-variables.php b/php/template-variables.php index bb44edf9d..5aaa99376 100644 --- a/php/template-variables.php +++ b/php/template-variables.php @@ -938,7 +938,7 @@ function qsm_questions_answers_shortcode_to_text( $mlw_quiz_array, $qmn_question $question_title = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer['question_title'], "Question-{$answer['id']}", "QSM Questions"); $question_description = ''; if ( ! empty( $answer[0] ) ) { - $question_description = do_shortcode( $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer[0], "question-description-{$answer['id']}", "QSM Questions" ) ); + $question_description = $mlwQuizMasterNext->pluginHelper->qsm_language_support( $answer[0], "question-description-{$answer['id']}", "QSM Questions" ); } if ( isset( $answer['question_title'] ) && '' !== $answer['question_title'] ) { $add_br = ''; @@ -1194,7 +1194,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 = wp_kses_post( $mlw_question_answer_display ); + $mlw_question_answer_display = do_shortcode( wp_kses_post( $mlw_question_answer_display ) ); if ( $total_question_cnt == $qsm_question_cnt && false == $remove_border ) { $extra_border_bottom_class = 'qsm-remove-border-bottom'; From c7647d32926c1918485e5a45e448c669ec15fb4b Mon Sep 17 00:00:00 2001 From: raeenasif Date: Wed, 22 Jun 2022 12:55:29 +0530 Subject: [PATCH 2/7] fixed issue with IOS devices --- mlw_quizmaster2.php | 1 + php/classes/class-qmn-quiz-manager.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 5e680fa56..4183306b3 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -334,6 +334,7 @@ public function qsm_admin_scripts_style( $hook ) { break; case 'style': wp_enqueue_style( 'wp-color-picker' ); + wp_enqueue_script( 'wp-color-picker'); wp_enqueue_media(); break; case 'options': diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index 56fd0439c..6e4fd9f6d 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -661,7 +661,7 @@ public function load_questions( $quiz_id, $quiz_options, $is_quiz_page, $questio } } $question_ids = apply_filters( 'qsm_load_questions_ids', $question_ids, $quiz_id, $quiz_options ); - $question_sql = implode( ', ', $question_ids ); + $question_sql = implode( ',', $question_ids ); if ( 1 == $quiz_options->randomness_order || 2 == $quiz_options->randomness_order ) { if ( isset($_COOKIE[ 'question_ids_'.$quiz_id ]) ) { @@ -669,7 +669,7 @@ public function load_questions( $quiz_id, $quiz_options, $is_quiz_page, $questio }else { $question_ids = apply_filters( 'qsm_load_questions_ids', $question_ids, $quiz_id, $quiz_options ); $question_ids = QMNPluginHelper::qsm_shuffle_assoc( $question_ids ); - $question_sql = implode( ', ', $question_ids ); + $question_sql = implode( ',', $question_ids ); ?>