Skip to content

lesson video allow html tag change with default wp kses #2950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions includes/class-sensei-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,7 @@ class Sensei_Frontend {
*/
public function __construct() {

$this->allowed_html = array(
'embed' => array(),
'iframe' => array(
'width' => array(),
'height' => array(),
'src' => array(),
'frameborder' => array(),
'allowfullscreen' => array(),
),
'video' => Sensei_Wp_Kses::get_video_html_tag_allowed_attributes(),
);
$this->allowed_html = Sensei_Wp_Kses::get_default_wp_kses_allowed_html();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider also allowing any tags here that wp_kses_post allows:

$this->allowed_html = array_merge( Sensei_Wp_Kses::get_default_wp_kses_allowed_html(), wp_kses_allowed_html( 'post' ) );

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you are right but this is a field for any video so we can't allow other tags, i thing does'e need to allow wp_kses_allowed_html( 'post' ),

Copy link
Author

@bhavik-dreamz bhavik-dreamz Mar 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateds now #2992

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. For example, Vimeo embeds include HTML tags like <p> and <a> that would be stripped out by this.

Besides, if we're allowing people to save HTML in the video embed code for a lesson in WP Admin, but then don't display it on the front-end, what's the point?


// Template output actions.
add_action( 'sensei_before_main_content', array( $this, 'sensei_output_content_wrapper' ), 10 );
Expand Down