Skip to content

Commit

Permalink
Merge pull request #2677 from QuizandSurveyMaster/dev-zubair
Browse files Browse the repository at this point in the history
fixed Vulnerability report
  • Loading branch information
zubairraeen authored Oct 15, 2024
2 parents 412365e + 553cb97 commit 2d5ba00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ tr .qsm-opt-desc {
#quiz_settings_wrapper .qsm-opt-desc {
display: none !important;
}
.qsm_page_qmn_global_settings .form-table td fieldset label,
.qsm_tab_content .form-table td fieldset label {
margin-right: 20px !important;
width: 100%;
Expand Down
3 changes: 3 additions & 0 deletions php/classes/class-qsm-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public static function generate_section( $fields, $section ) {
case 'number':
$sanitized_value = isset( $_POST[ $key ] ) ? intval( $_POST[ $key ] ) : "";
break;
case 'image':
$sanitized_value = isset( $_POST[ $key ] ) ? esc_url_raw( wp_unslash( $_POST[ $key ] ) ) : "";
break;
default:
$sanitized_value = isset( $_POST[ $key ] ) ? sanitize_text_field( wp_unslash( $_POST[ $key ] ) ) : "";
break;
Expand Down
11 changes: 5 additions & 6 deletions php/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,11 @@ function qsm_generate_fb_header_metadata() {
$sharing = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'facebook_sharing_text', '' );
$sharing = apply_filters( 'mlw_qmn_template_variable_results_page', $sharing, $results_array );
$default_fb_image = QSM_PLUGIN_URL . 'assets/icon-200x200.png';
$get_fb_sharing_image = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'result_page_fb_image', '' );
if ( empty( $get_fb_sharing_image ) ) {
$get_fb_sharing_image = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'result_page_fb_image', '' );
}
if ( '' !== $get_fb_sharing_image && filter_var( $get_fb_sharing_image, FILTER_VALIDATE_URL ) ) {
$default_fb_image = $get_fb_sharing_image;
$fb_sharing_image_quiz_options = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_options', 'result_page_fb_image', '' );
$fb_sharing_image_quiz_text = $mlwQuizMasterNext->pluginHelper->get_section_setting( 'quiz_text', 'result_page_fb_image', '' );
$get_fb_sharing_image = ! empty($fb_sharing_image_quiz_options) ? $fb_sharing_image_quiz_options : $fb_sharing_image_quiz_text;
if ( ! empty($get_fb_sharing_image) && filter_var($get_fb_sharing_image, FILTER_VALIDATE_URL) ) {
$default_fb_image = esc_url($get_fb_sharing_image);
}
$post = $wp_query->get_queried_object();
$pagename = $post->post_title;
Expand Down

0 comments on commit 2d5ba00

Please sign in to comment.