[wp-trac] [WordPress Trac] #43215: Allow wp_kses to pass allowed CSS properties
WordPress Trac
noreply at wordpress.org
Thu Jan 16 07:14:42 UTC 2025
#43215: Allow wp_kses to pass allowed CSS properties
-----------------------------+------------------------------
Reporter: mclaurent | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Security | Version: 4.9.2
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by davidtheplumber):
Use a third-party library like PHP Simple HTML DOM Parser to allow inline
styles for specific cases:
{{{
require_once('simple_html_dom.php');
$html = str_get_html($google_tag_manager_noscript);
foreach ($html->find('iframe') as $iframe) {
$iframe->style = 'display:none;visibility:hidden';
}
$sanitized_html = wp_kses($html, $allowed_output_html,
$allowed_output_protocol);
echo $sanitized_html;
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43215#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list