-
Notifications
You must be signed in to change notification settings - Fork 98
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
Comments
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, |
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. |
Hi I am having this issue on my site, using Divi. https://snipboard.io/fIDlwq.jpg |
For the Divi theme, this code works, just add it as a simple plugin: https://gist.github.com/milosh-96/dbfd2c342e25ac697b82e33c2380755b |
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.
The text was updated successfully, but these errors were encountered: