Skip to content
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

Gallery Style in player-gallery.php is not applied #428

Open
nerdfactor opened this issue Dec 14, 2021 · 3 comments
Open

Gallery Style in player-gallery.php is not applied #428

nerdfactor opened this issue Dec 14, 2021 · 3 comments

Comments

@nerdfactor
Copy link

The last commit in player-gallery.php (23ba244) introduced a bug, where the $gallery_style is sanitized by wp_kses_post() (line 116), removing the <style> tags and therefore not applying the style for the player gallery and in turn printing the raw css to the page.

Using wp_kses_post() may not be the right way, if the goal was to sanitize the css within the style tags. The variables $selector, $float and $itemwith within the css block are generated by your code and are not from user input. Therefore, sanitation seems to be not required at this point.

Otherwise you might want to add <style> to the allowed protocols globally or specifically for that call to wp_kses(). I can provide a pull request for that.

@savvasha
Copy link
Collaborator

Hi @nerdfactor ,

I am not able to reproduce this issue. I am using the latest version of SportsPress and Rookie theme. Maybe is a theme related issue? https://snipboard.io/h5f3qX.jpg

Thanks,
Savvas

@nerdfactor
Copy link
Author

Hi @savvasha,

you are correct. The bug can't be reproduced with the default Twenty Twenty-One theme, as it does support html5. I assume your rookie theme has the same html5 support. The $gallery_style is only set if the theme does not support html5 (see lines 93 to 113 in player-gallery.php). Therefore only those type of themes are affected.

@zakkyb
Copy link

zakkyb commented Sep 8, 2022

Hi I am having this issue on my site, using Divi. https://snipboard.io/fIDlwq.jpg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants