Allow support for allowlisted iframe sources in Content\text\BBCode::convert

- Support Youtube, Vimeo and unused local embeds
pull/9675/head
Hypolite Petovan 2020-12-18 01:17:49 -05:00
rodzic ec0c9dcdb1
commit 0781f28ca6
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -1876,6 +1876,14 @@ class BBCode
$config = \HTMLPurifier_HTML5Config::createDefault();
$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', [
'noreferrer' => true,
'noopener' => true,