diff --git a/php/classes/class-qmn-quiz-manager.php b/php/classes/class-qmn-quiz-manager.php index a3a70a293..707e22ec4 100644 --- a/php/classes/class-qmn-quiz-manager.php +++ b/php/classes/class-qmn-quiz-manager.php @@ -1362,7 +1362,7 @@ public function display_questions( $qmn_quiz_options, $qmn_quiz_questions, $qmn_ $question_id_list = ''; $animation_effect = isset( $qmn_quiz_options->quiz_animation ) && '' !== $qmn_quiz_options->quiz_animation ? ' animated ' . $qmn_quiz_options->quiz_animation : ''; $enable_pagination_quiz = isset( $qmn_quiz_options->enable_pagination_quiz ) && $qmn_quiz_options->enable_pagination_quiz ? $qmn_quiz_options->enable_pagination_quiz : 0; - $pagination_option = $qmn_quiz_options->pagination; + $pagination_option = intval( $qmn_quiz_options->pagination ); $total_pagination = $total_pages_count = 1; if ( $enable_pagination_quiz && $pagination_option ) { $total_pages_count = count( $qmn_quiz_questions ); diff --git a/php/classes/class-qsm-contact-manager.php b/php/classes/class-qsm-contact-manager.php index 76894ca73..1bead68fc 100644 --- a/php/classes/class-qsm-contact-manager.php +++ b/php/classes/class-qsm-contact-manager.php @@ -331,10 +331,6 @@ public static function save_fields( $quiz_id, $fields ) { return true; } - if ( ! is_array( $fields ) || empty( $fields ) ) { - //return false; - } - $quiz_id = intval( $quiz_id ); if ( 0 === $quiz_id ) { return false; @@ -352,9 +348,17 @@ public static function save_fields( $quiz_id, $fields ) { if ( ! empty( $fields ) ) { $total_fields = count( $fields ); for ( $i = 0; $i < $total_fields; $i ++ ) { - $label = $is_not_allow_html ? $fields[ $i ]['label'] : wp_kses( wp_unslash( $fields[ $i ]['label'] ), $allowed_html ); + $label = $is_not_allow_html ? $fields[ $i ]['label'] : sanitize_text_field( wp_unslash( $fields[ $i ]['label'] ), $allowed_html ); $fields[ $i ]['label'] = $label; $mlwQuizMasterNext->pluginHelper->qsm_register_language_support( $label, "quiz_contact_field_text-{$i}-{$quiz_id}" ); + if ( ! empty( $fields[ $i ]['options'] ) ) { + $options = sanitize_text_field( wp_unslash( $fields[ $i ]['options'] ) ); + $fields[ $i ]['options'] = $options; + $option_values = explode(",", $options); + foreach ( $option_values as $option_key => $option ) { + $mlwQuizMasterNext->pluginHelper->qsm_register_language_support( $option, "quiz_contact_field_text-{$i}-{$option_key}-{$quiz_id}" ); + } + } } } @@ -535,19 +539,20 @@ public static function generate_contact_field( $field, $index, $quiz_options, $d
$option ) { ?> -
- - -
+
+ quiz_id}" ) ); ?>" + /> + +
$option ) { ?> -