aruru
August 10, 2021, 12:26pm
1
Hi. I want to allow Iframe to be added in one table and dosnt want to uncheck “remove Xss” in advanced options.
Where do add this?
Tested to add this code:
$PurifierConfig = HTMLPurifier_Config::createDefault();
$PurifierConfig->set('Filter', 'HTML.SafeIframe', true);
in Global, All pages, Page_loading, result an error: “HTMLPurifier_Config’ not found”
arbei
August 10, 2021, 2:28pm
2
You may try \HTMLPurifier_Config.
aruru
August 10, 2021, 2:57pm
3
Thanks, helped me to solve the problem. This works:
$PurifierConfig = \HTMLPurifier_Config::createDefault();
$PurifierConfig->set('HTML.SafeIframe', true);
$PurifierConfig->set('URI.SafeIframeRegexp', '%^https://(www.youtube.com/embed/|player.vimeo.com/video/)%');
Needed to add SafeIframeRegexp urls aswell and have the code in All pages, Global Code.