From 7455275df6feafab68fad32c8ecd5cb428c303bd Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Wed, 13 Nov 2024 19:29:19 +0530 Subject: [PATCH 1/4] update readme tested up to 6.7 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 6dc5bb4b..b5cc6168 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: quizsurvey,expresstech Tags: quiz, survey, test, exam, online assessment Requires at least: 4.9 -Tested up to: 6.6 +Tested up to: 6.7 Requires PHP: 5.4 Stable tag: 9.2.2 License: GPLv2 From fc86e2ccee12d59ea34b225e85453ddcdac8c06b Mon Sep 17 00:00:00 2001 From: etchirag Date: Mon, 25 Nov 2024 10:42:18 +0530 Subject: [PATCH 2/4] Updated eschtml function with wpksespost for allow some html tags --- php/shortcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/shortcodes.php b/php/shortcodes.php index 45dad941..1684a8ff 100644 --- a/php/shortcodes.php +++ b/php/shortcodes.php @@ -45,9 +45,9 @@ function qsm_quiz_link_shortcode( $atts, $content = '' ) { // Craft the target attribute if one is passed to shortcode $target_html = ''; if ( ! empty( $target ) ) { - return "" . esc_html( $content ) . ''; + return "" . wp_kses_post( $content ) . ''; } else { - return "" . esc_html( $content ) . ''; + return "" . wp_kses_post( $content ) . ''; } } From 8064b836344b1b3b1990e142ae9d5021618b5af4 Mon Sep 17 00:00:00 2001 From: etchirag Date: Mon, 25 Nov 2024 12:25:13 +0530 Subject: [PATCH 3/4] Updated allowd tags option for qsm link --- php/shortcodes.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/php/shortcodes.php b/php/shortcodes.php index 1684a8ff..940c4a05 100644 --- a/php/shortcodes.php +++ b/php/shortcodes.php @@ -44,10 +44,16 @@ function qsm_quiz_link_shortcode( $atts, $content = '' ) { // Craft the target attribute if one is passed to shortcode $target_html = ''; + $allowed_tags = apply_filters( 'qsm_quiz_link_allowed_tags', array( + 'span' => array(), + 'b' => array(), + 'strong' => array(), + ) ); + if ( ! empty( $target ) ) { - return "" . wp_kses_post( $content ) . ''; + return "" . wp_kses( $content, $allowed_tags ) . ''; } else { - return "" . wp_kses_post( $content ) . ''; + return "" . wp_kses( $content, $allowed_tags ) . ''; } } From bc8a3bd5da594b02d3af9e55e82ce34e7407c06d Mon Sep 17 00:00:00 2001 From: etchirag Date: Mon, 25 Nov 2024 12:34:09 +0530 Subject: [PATCH 4/4] Updated allowd tags option for qsm link --- php/shortcodes.php | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/php/shortcodes.php b/php/shortcodes.php index 940c4a05..3076f653 100644 --- a/php/shortcodes.php +++ b/php/shortcodes.php @@ -45,10 +45,45 @@ function qsm_quiz_link_shortcode( $atts, $content = '' ) { // Craft the target attribute if one is passed to shortcode $target_html = ''; $allowed_tags = apply_filters( 'qsm_quiz_link_allowed_tags', array( - 'span' => array(), + 'span' => array( + 'class' => true, + 'id' => true, + 'style' => true, + ), + 'a' => array( + 'href' => true, + 'target' => true, + 'class' => true, + 'id' => true, + 'rel' => true, + ), + 'img' => array( + 'src' => true, + 'alt' => true, + 'width' => true, + 'height' => true, + 'class' => true, + 'id' => true, + ), + 'div' => array( + 'class' => true, + 'id' => true, + 'style' => true, + ), + 'h1' => array( 'class' => true ), + 'h2' => array( 'class' => true ), + 'h3' => array( 'class' => true ), + 'h4' => array( 'class' => true ), + 'h5' => array( 'class' => true ), + 'h6' => array( 'class' => true ), + 'p' => array(), + 'br' => array(), 'b' => array(), 'strong' => array(), - ) ); + 'i' => array(), + 'em' => array(), + 'u' => array(), + ) ); if ( ! empty( $target ) ) { return "" . wp_kses( $content, $allowed_tags ) . '';