SportsPress icon indicating copy to clipboard operation
SportsPress copied to clipboard

Gallery Style in player-gallery.php is not applied

Open nerdfactor opened this issue 3 years ago • 3 comments

The last commit in player-gallery.php (23ba2446b17a6f0f204104978014595ac8984ccb) introduced a bug, where the $gallery_style is sanitized by wp_kses_post() (line 116), removing the

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

nerdfactor avatar Dec 14 '21 15:12 nerdfactor

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

savvasha avatar Dec 14 '21 17:12 savvasha

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.

nerdfactor avatar Dec 14 '21 18:12 nerdfactor

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

zakkyb avatar Sep 08 '22 12:09 zakkyb