Allow support for allowlisted iframe sources in Content\text\BBCode::convert
- Support Youtube, Vimeo and unused local embeds
This commit is contained in:
parent
ec0c9dcdb1
commit
0781f28ca6
|
@ -1876,6 +1876,14 @@ class BBCode
|
||||||
|
|
||||||
$config = \HTMLPurifier_HTML5Config::createDefault();
|
$config = \HTMLPurifier_HTML5Config::createDefault();
|
||||||
$config->set('HTML.Doctype', 'HTML5');
|
$config->set('HTML.Doctype', 'HTML5');
|
||||||
|
$config->set('HTML.SafeIframe', true);
|
||||||
|
$config->set('URI.SafeIframeRegexp', '%^(?:
|
||||||
|
https://www.youtube.com/embed/
|
||||||
|
|
|
||||||
|
https://player.vimeo.com/video/
|
||||||
|
|
|
||||||
|
' . DI::baseUrl() . '/oembed/ # Has to change with the source in Content\Oembed::iframe
|
||||||
|
)%xi');
|
||||||
$config->set('Attr.AllowedRel', [
|
$config->set('Attr.AllowedRel', [
|
||||||
'noreferrer' => true,
|
'noreferrer' => true,
|
||||||
'noopener' => true,
|
'noopener' => true,
|
||||||
|
|
Loading…
Reference in a new issue